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

body {
  background-color: #1a1409;
  background-image: url('../img/background.gif');
  background-size: auto;
  background-repeat: repeat;
  background-attachment: fixed;
  color: #d9c7a8;
  line-height: 1.6;
}

.container,
.header-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 导航栏样式 */
.navbar {
  background-color: #000000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-size: 24px;
  font-weight: bold;
  color: #e0e0e0;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 25px;
}

.nav-links a {
  color: #b0b0b0;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #64b5f6;
}

/* 用户横幅样式 */
.user-profile-head-banner {
  padding-top: 16px;
  width: 1320px;
  margin: auto;
  height: 100px;
  background-repeat: no-repeat;
  background-position: 50%;
  background-size: cover;
  background-image: url('../img/banner.gif');
}

/* 主要内容样式 */
.main {
  padding: 0;
}

/* 标签导航栏样式 - 优化为暗黑主题 */
.navbar-tag {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 15px;
  position: sticky;
  top: -15px; /* 调整位置，避免与顶部导航栏重叠 */
  z-index: 100;
  will-change: transform; /* 提示浏览器优化定位性能 */
}

.tag-navigation {
  background-color: #242429; /* 匹配header的背景色 */
  border-bottom: 1px solid #333; /* 深色边框 */
  height: 60px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center; /* 垂直方向居中对齐 */
  border-radius: 8px;
}

.tag-nav-item {
  padding: 6px 20px;
  border-radius: 20px;
  background-color: #2d2d2d; /* 与文章内标签背景色一致 */
  color: #b0b0b0;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  height: 35px;
}

.tag-nav-item:hover {
  background-color: #3a3a3a;
  color: #d9c7a8;
  border-color: #64b5f6;
}

.tag-nav-item.active {
  background-color: #1976d2;
  color: #ffffff;
  border-color: #64b5f6;
  box-shadow: 0 2px 6px rgba(100, 181, 246, 0.3);
}

.tag-nav-item.active:hover {
  background-color: #1565c0;
}

/* 下拉菜单样式 */
.tag-nav-item.dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
  padding-right: 30px;
}

.tag-nav-item.dropdown .tag-text {
  display: inline-block;
  vertical-align: middle;
}

.tag-nav-item.dropdown .dropdown-icon {
  display: inline-block;
  vertical-align: middle;
  font-size: 12px;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.tag-nav-item.dropdown.active .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #2d2d2d;
  min-width: 150px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.dropdown-item {
  padding: 10px 15px;
  color: #b0b0b0;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: #3a3a3a;
  color: #d9c7a8;
}

.dropdown-item.active {
  background-color: #1976d2;
  color: #ffffff;
}

/* 左右布局容器 */
.content-wrapper {
  display: flex;
  gap: 15px;
}

/* 侧边栏样式 */
.sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* 文章信息流样式 */
.blog-feed {
  flex: 1;
}

/* 修改文章列表布局为单列 */
.blog-posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

/* 统一文章卡片样式 */
.post {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 450px;
  background-color: #1e1e1e;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.post:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 文章头部样式 */
.post-header {
  padding: 20px 25px 15px;
  border-bottom: 1px solid #333;
}

.post-meta {
  display: flex;
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.post-title {
  font-size: 20px;
  margin-bottom: 10px;
}

.post-title a {
  color: #e0e0e0;
  text-decoration: none;
  transition: color 0.3s;
}

.post-title a:hover {
  color: #64b5f6;
}

.post-tags {
  margin-top: 8px;
}

/* 文章主体 - 包含摘要和图片（同一层次） */
.post-body {
  display: flex;
  flex-direction: row;
  flex: 1;
}

.post-content-wrapper {
  flex: 1;
  padding: 20px 25px;
  display: flex;
  align-items: center;
}

.post-excerpt {
  color: #b0b0b0;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.7;
  font-size: 15px;
  margin: 0;
}

/* 图片区域样式 - 与摘要同一层次 */
.post-image {
  width: 250px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  margin: 0 20px;
  border-radius: 8px;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* 文章底部样式 */
.post-footer {
  padding: 15px 25px 20px;
  border-top: 1px solid #333;
  text-align: right;
}

/* 按钮样式 */
.read-more {
  display: inline-block;
  background-color: #1976d2;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.3s;
}

.read-more:hover {
  background-color: #1565c0;
}

/* 标签样式 */
.tag {
  display: inline-block;
  background-color: #2d2d2d;
  padding: 3px 10px;
  border-radius: 15px;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 8px;
  color: #b0b0b0;
}

/* 点赞按钮样式 */
.like-button {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.3s;
  padding: 5px 10px;
  border-radius: 4px;
}

.like-button:hover {
  color: #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
}

.like-button .fas {
  color: #ff4444;
}

.like-button.liked-animation {
  animation: likeEffect 1s ease-in-out;
}

@keyframes likeEffect {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* 头部样式 */
.header {
  background: #242429;
  color: #fff;
  padding: 30px 0;
  text-align: left;
  border-radius: 8px;
}

/* 个人资料区域样式 */
.profile-section {
  display: flex;
  align-items: flex-start;
  text-align: left;
  padding: 10px 0;
}

/* 头像样式 */
.profile-avatar {
  margin-right: 20px;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #d9c7a8;
  object-fit: cover;
}

/* 个人信息样式 */
.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 28px;
  margin-bottom: 15px;
  color: #d9c7a8;
}

/* 统计数据样式 */
.profile-stats {
  display: flex;
  margin-bottom: 15px;
}

.stat-item {
  margin-right: 30px;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: bold;
  color: #d9c7a8;
}

.stat-label {
  display: block;
  font-size: 13px;
  color: #998877;
  margin-top: 3px;
}

/* 个人简介样式 */
.profile-bio {
  font-size: 15px;
  line-height: 1.6;
  color: #d9c7a8;
  max-width: 800px;
  margin-bottom: 0;
}

/* 用户名称样式 */
.user-profile-head-name {
  color: #d3d3d3;
  font-size: 22px;
  font-weight: 500;
  line-height: 24px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  word-break: break-all;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
}

/* 编程年龄标签 */
.person-code-age {
  background-color: #FAD8C3;
  color: #B94027;
  height: 16px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  border-radius: 8px;
  margin-left: 4px;
  margin-top: 4px;
  -webkit-box-flex: inherit;
  -ms-flex: inherit;
  flex: inherit;
}

.person-code-age img {
  width: 22px;
  height: 22px;
  display: block;
}

.person-code-age span {
  padding: 0 6px 0 4px;
  font-size: 12px;
  display: block;
  height: 16px;
  line-height: 16px;
  text-align: center;
}

/* 模块标题样式 */
.module-title {
  color: #d9c7a8;
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

/* 说说模块样式 */
.miniblog-wrapper {
  background-color: #1e1e1e;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.miniblog-list {
  max-height: 400px;
  overflow-y: auto;
}

.miniblog-post {
  padding: 15px 0;
  border-bottom: 1px solid #333;
}

.miniblog-post:last-child {
  border-bottom: none;
}

.miniblog-post-content {
  color: #b0b0b0;
  line-height: 1.6;
  font-size: 14px;
}

.miniblog-post-meta {
  color: #888;
  font-size: 12px;
  margin-top: 8px;
}

/* 点赞榜模块样式 */
.top-likes-wrapper {
  background-color: #1e1e1e;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.top-likes-list {
  max-height: 800px;
  overflow-y: auto;
}

.top-like-item {
  padding: 12px 0;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.top-like-item:last-child {
  border-bottom: none;
}

.top-like-rank {
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background-color: #1976d2;
  color: white;
  font-size: 12px;
  flex-shrink: 0;
}

.top-like-rank.top3 {
  background-color: #ff6b6b;
}

.top-like-content {
  flex: 1;
}

.top-like-title {
  color: #d9c7a8;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.top-like-date {
  color: #888;
  font-size: 12px;
}

.top-like-count {
  color: #ff6b6b;
  font-size: 12px;
  margin-top: 4px;
}

/* 侧边栏滚动条样式 */
.miniblog-list::-webkit-scrollbar,
.top-likes-list::-webkit-scrollbar {
  width: 6px;
}

.miniblog-list::-webkit-scrollbar-track,
.top-likes-list::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 3px;
}

.miniblog-list::-webkit-scrollbar-thumb,
.top-likes-list::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.miniblog-list::-webkit-scrollbar-thumb:hover,
.top-likes-list::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* 加载状态样式 */
.loading {
  text-align: center;
  padding: 40px 0;
  grid-column: 1 / -1;
}

.loading i {
  font-size: 36px;
  color: #64b5f6;
  margin-bottom: 15px;
  display: block;
}

/* 页脚样式 */
.footer {
  background-color: #000000;
  color: #e0e0e0;
  padding: 30px 0;
  text-align: center;
}

.footer p {
  opacity: 0.8;
}

/* 文章详情页样式 - 带具体前缀避免冲突 */

/* 文章详情页容器样式 */
.post-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #1e1e1e;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

/* 文章详情页标题样式 */
.post-detail .post-header {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #333;
}

/* 文章详情页标题样式 */
.post-detail .post-title {
  font-size: 28px !important;
  margin-bottom: 15px;
  color: #e0e0e0;
  -webkit-line-clamp: unset !important;
  display: block !important;
}

/* 文章详情页内容区域样式 */
.post-detail .post-body {
  line-height: 1.8;
  color: #b0b0b0;
  display: block !important;
  align-items: normal !important;
  flex-direction: column !important;
}

/* 文章详情页元数据样式 */
.post-detail .post-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #888;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}

/* 文章详情页图片样式 */
.post-detail .post-image {
  width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 8px;
}

.post-detail .post-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: inherit;
  position: relative;
  transform: none;
}

/* 确保其他文章详情页元素样式正确 */
.post-detail #post-content {
  padding: 0;
}

.post-detail .tags {
  margin-top: 20px;
}

.post-detail .error {
  text-align: center;
  padding: 40px 0;
  color: #ff6b6b;
}

.post-detail .loading {
  text-align: center;
  padding: 60px 0;
  grid-column: auto;
}