:root {
  --bg-body: #121212;
  --bg-card: #1e1e1e;
  --text-main: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent-color: #0d6efd;
  --danger-color: #dc3545;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding-bottom: 80px;
}

body::before {
  content: "";
  /* 🌟 固定定位，脱离文档流，绝对不滚动 */
  position: fixed;

  /* 🌟 核心定位：锁死在屏幕左下角 */
  left: 0;
  bottom: 0;

  /* 🌟 核心大小：占据屏幕刚好四分之一的区域 (宽50%，高50%) */
  width: 50vw;
  height: 50vh;

  background-image: url('/static/images/bg_img.png');

  /* contain 保证图片在这个区域内保持原比例，并且完整显示 */
  background-size: contain;
  background-position: left bottom;
  background-repeat: no-repeat;

  /* 放在最底层 */
  z-index: -1;

  /* 💡 顶级质感优化：你可以降低透明度，让它像幽灵水印一样若隐若现 */
  opacity: 0.6;
  /* 透明度 30% */

  /* 可选：如果图片有底色，可以用这个魔法属性滤掉背景，完美融入网页 */
  /* mix-blend-mode: screen; */
}

body .text-muted {
  color: #aaa !important;
  /* 你想要的颜色 */
}

.bg-image {
  background-image: image();
}

a {
  text-decoration: none;
}

.custom-card {
  background-color: var(--bg-card);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  /* 为了定位编辑按钮 */
}

/* 编辑按钮样式 */
.edit-btn-absolute {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s;
  font-size: 1.1rem;
  z-index: 10;
}

.edit-btn-absolute:hover {
  color: var(--accent-color);
}

/* 头部样式 */
.profile-header {
  text-align: center;
}

.avatar-box {
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent-color);
  padding: 3px;
  background: var(--bg-card);
  position: relative;
}

.avatar-box img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.social-link {
  color: var(--text-muted);
  font-size: 1.5rem;
  margin: 0 10px;
  transition: color 0.3s;
}

.social-link:hover {
  color: var(--accent-color);
}

/* 导航切换 */
.nav-switch {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #333;
}

.nav-switch-item {
  padding: 10px 25px;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  position: relative;
  transition: color 0.3s;
}

.nav-switch-item:hover {
  color: var(--text-main);
}

.nav-switch-item.active {
  color: var(--accent-color);
}

.nav-switch-item.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 3px 3px 0 0;
}

/* 内容样式 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  border-left: 4px solid var(--accent-color);
  padding-left: 10px;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0;
}

.skill-tag {
  background-color: rgba(13, 110, 253, 0.15);
  color: #4da3ff;
  border: 1px solid rgba(13, 110, 253, 0.3);
  padding: 5px 12px;
  border-radius: 20px;
  margin-right: 8px;
  margin-bottom: 8px;
  display: inline-block;
  font-size: 0.9rem;
}

.project-item {
  background-color: #252525;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  transition: transform 0.2s;
  position: relative;
}

.project-item:hover {
  transform: translateY(-3px);
  background-color: #2a2a2a;
}

/* 项目删除按钮 */
.project-action-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
}

.project-action-btn:hover {
  color: var(--danger-color);
}

/* 文章列表 */
.article-item {
  border-bottom: 1px solid #333;
  padding: 1.5rem 0;
  position: relative;
}

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

.article-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-main);
  text-decoration: none;
  display: block;
  margin: 5px 0;
}

.article-title:hover {
  color: var(--accent-color);
}

.article-summary {
  color: #bbb;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-right: 80px;
}

/* 右侧留白给按钮 */

.article-actions {
  position: absolute;
  right: 0;
  top: 1.5rem;
}

/* 切换动画 */
.content-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.content-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 模态框深色适配 */
.modal-content {
  background-color: #2b2b2b;
  color: #fff;
  border: 1px solid #444;
}

.modal-header,
.modal-footer {
  border-color: #444;
}

.form-control,
.form-select {
  background-color: #333;
  border-color: #444;
  color: #fff;
}

.form-control:focus {
  background-color: #333;
  color: #fff;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
  color: #ccc;
}

/* 新加载的文章淡入效果 */
.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======项目悬浮显示框===== */

/* --- 问题1解决方案：限制描述文字高度 --- */
.project-desc-limit {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* 限制显示2行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  /* 关键：强制打断长单词(如一长串m)，防止撑开div */
  min-height: 40px;
  /* 保持高度统一，防止卡片高度跳动 */
}

/* --- 问题2解决方案：悬停遮罩层 --- */
.project-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 20px;
  border-radius: 8px;

  /* 默认隐藏状态保持不变 */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;

  /* 🔥 核心修改：垂直 Flex 布局 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* 上下撑开 */
}



/* 悬停时显示遮罩 */
.project-item:hover .project-hover-overlay {
  opacity: 1;
  visibility: visible;
}

/* --- 文字滚动区域 --- */
.overlay-scroll-area {
  /* 🔥 核心修改：占据剩余空间 */
  flex-grow: 1;
  overflow-y: auto;
  /* 超出只在这里滚动 */

  /* 防止文字紧贴滚动条 */
  padding-right: 5px;
  margin-bottom: 15px;
  /* 给底部按钮留出间距，防止视觉拥挤 */

  /* 强制换行，解决 mmmm 问题 */
  word-break: break-all;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e0e0e0;
}

/* 自定义滚动条样式 */
.overlay-scroll-area::-webkit-scrollbar {
  width: 4px;
}

.overlay-scroll-area::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 2px;
}

/* --- 调整按钮层级 --- */
/* 确保删除按钮和详情链接在遮罩层之上，方便点击 */
.project-action-btn,
.project-link-btn {
  z-index: 20;
  position: relative;
}

/* --- 底部按钮区域 --- */
.overlay-footer {
  /* 🔥 核心修改：固定不收缩 */
  flex-shrink: 0;
  text-align: right;
  /* 按钮靠右 */
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  /* 可选：加个分割线更好看 */
}

/* 链接样式微调 */
.overlay-link {
  color: #66b0ff;
  /* 亮蓝色，在深底上更清晰 */
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.overlay-link:hover {
  color: #fff;
}