/* ========== GitHub Projects Widget ========== */

/* 右侧项目按钮容器 */
.projects-bar {
  position: fixed;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 单个项目按钮 - 平行四边形 */
.project-btn {
  background: #fff;
  color: #5e6b50;
  border: 1.5px solid #e0dbd2;
  padding: 0.55rem 1.2rem 0.55rem 1.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transform: skewX(-12deg);
  transition: all 0.3s;
  box-shadow: -1px 0 4px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-btn span {
  display: inline-block;
  transform: skewX(12deg);
}

.project-btn:hover {
  border-color: #c05845;
  color: #c05845;
  background: #fdf5f3;
  box-shadow: -2px 0 8px rgba(192, 88, 69, 0.15);
  max-width: 180px;
}

.project-btn.active {
  background: #5e6b50;
  color: #fff;
  border-color: #5e6b50;
  box-shadow: -2px 0 8px rgba(94, 107, 80, 0.3);
}

/* 遮罩 */
.projects-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.projects-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* README 面板 */
.readme-panel {
  position: fixed;
  right: -420px;
  top: 0;
  width: 400px;
  height: 100vh;
  background: #faf6f1;
  border-left: 1px solid #ede8df;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 200;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.readme-panel.open {
  right: 0;
}

/* README 头部 */
.readme-header {
  padding: 1.5rem;
  border-bottom: 1px solid #ede8df;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.readme-header h2 {
  font-size: 1.1rem;
  color: #3e3b33;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.readme-header .close-btn {
  background: none;
  border: none;
  color: #b0a898;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.readme-header .close-btn:hover {
  color: #c05845;
  background: #fdf5f3;
}

/* README 内容 */
.readme-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.8;
  color: #3e3b33;
}

.readme-content h1,
.readme-content h2,
.readme-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #3e3b33;
}

.readme-content h1 { font-size: 1.3rem; }
.readme-content h2 { font-size: 1.15rem; }
.readme-content h3 { font-size: 1rem; }

.readme-content p {
  margin-bottom: 0.75rem;
}

.readme-content code {
  background: #f0ece4;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.readme-content pre {
  background: #f0ece4;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.readme-content pre code {
  background: none;
  padding: 0;
}

.readme-content a {
  color: #c05845;
  text-decoration: underline;
}

.readme-content ul,
.readme-content ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.readme-content li {
  margin-bottom: 0.3rem;
}

.readme-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.readme-content blockquote {
  border-left: 3px solid #c05845;
  padding-left: 1rem;
  margin: 0.75rem 0;
  color: #6b5e50;
}

/* 加载状态 */
.readme-loading {
  text-align: center;
  padding: 2rem;
  color: #b0a898;
  font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 480px) {
  .projects-bar {
    display: none;
  }

  .readme-panel {
    width: 100%;
    right: -100%;
  }
}
