/* ============================================================
   project.css — 项目浏览页（绿白条纹背景 + 精致卡片）
   ============================================================ */

:root {
  --pj-accent: #2d5a3d;
  --pj-gold: #c9b896;
  --pj-bg: #f5f2eb;
  --pj-code-bg: #1e293b;
}

/* ---- 条纹纹理背景 ---- */
.stripe-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  --s: 80px;
  --c1: #f5f2eb;
  --c2: #c5d5c8;
  --_g: var(--c2) 4% 14%, var(--c1) 14% 24%, var(--c2) 22% 34%,
    var(--c1) 34% 44%, var(--c2) 44% 56%, var(--c1) 56% 66%, var(--c2) 66% 76%,
    var(--c1) 76% 86%, var(--c2) 86% 96%;
  background:
    radial-gradient(100% 100% at 100% 0, var(--c1) 4%, var(--_g), #0003 96%, #0000),
    radial-gradient(100% 100% at 0 100%, #0000, #0003 4%, var(--_g), var(--c1) 96%) var(--c1);
  background-size: var(--s) var(--s);
  opacity: 0.3;
  animation: stripeDrift 20s linear infinite;
}
@keyframes stripeDrift {
  0%   { background-position: 0 0; }
  100% { background-position: var(--s) var(--s); }
}

/* ---- 页面容器 ---- */
.project-page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 36px 1.5rem 72px;
  position: relative;
  z-index: 1;
}

/* ---- 头部卡片 ---- */
.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 22px 28px;
  background: #fff;
  border: 1px solid #e8e4dd;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.project-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.project-header .author {
  font-size: 0.8rem;
  color: #999;
  margin-left: 2px;
}

/* ---- 按钮 ---- */
.project-actions { display: flex; gap: 10px; }

.project-actions .btn {
  font-size: 0.82rem;
  padding: 8px 20px;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.25s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.project-actions .btn-outline {
  background: #fff;
  border: 1px solid #ddd;
  color: #555;
}
.project-actions .btn-outline:hover {
  border-color: var(--pj-accent);
  color: var(--pj-accent);
  background: #f8faf7;
}

.project-actions .btn-fill {
  background: var(--pj-accent);
  border: 1px solid var(--pj-accent);
  color: #fff;
}
.project-actions .btn-fill:hover {
  background: #3d7a53;
  border-color: #3d7a53;
  transform: translateY(-1px);
}

/* ---- 双栏布局 ---- */
.project-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

/* ---- 面板通用 ---- */
.tree-panel,
.content-panel,
.project-description {
  background: #fff;
  border: 1px solid #e8e4dd;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.tree-panel-header,
.content-panel-header {
  padding: 13px 20px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #999;
  border-bottom: 1px solid #f0ede6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafaf7;
}

.tree-panel-body {
  max-height: 480px;
  overflow-y: auto;
  padding: 4px 0;
}

/* ---- 文件树项 ---- */
.tree-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px 7px 14px;
  font-size: 0.84rem;
  color: #444;
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
  border-left: 2px solid transparent;
}
.tree-item:hover {
  background: rgba(45,90,61,0.04);
  border-left-color: var(--pj-accent);
}
.tree-item .fa-folder    { color: var(--pj-gold); font-size: 0.8rem; width: 16px; text-align: center; }
.tree-item .fa-file      { color: #bbb; font-size: 0.78rem; width: 16px; text-align: center; }
.tree-item .fa-level-up  { color: #ccc; font-size: 0.78rem; width: 16px; text-align: center; }
.tree-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-item-size {
  margin-left: auto;
  font-size: 0.68rem;
  color: #ccc;
  flex-shrink: 0;
  font-family: 'SF Mono','Consolas',monospace;
}

/* ---- 右侧内容面板 ---- */
.content-panel-header {
  font-family: 'SF Mono','Fira Code','Consolas',monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: #555;
}

.content-panel-header .lang-tag {
  font-size: 0.66rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(45,90,61,0.08);
  color: var(--pj-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-panel-body {
  max-height: 560px;
  overflow: auto;
}

/* 空状态占位 */
.content-panel-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #ccc;
  font-size: 0.88rem;
  flex-direction: column;
  gap: 8px;
}
.content-panel-placeholder i {
  font-size: 2rem;
  opacity: 0.3;
}

/* ---- 代码预览 ---- */
.code-view {
  margin: 0;
  padding: 22px 26px;
  font-family: 'SF Mono','Fira Code','Cascadia Code','Consolas',monospace;
  font-size: 0.84rem;
  line-height: 1.7;
  color: #e2e8f0;
  background: var(--pj-code-bg);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- 项目描述 ---- */
.project-description {
  margin-top: 24px;
  padding: 24px 28px;
}

.project-description h5 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: #999;
  text-transform: uppercase;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0ede6;
}

.project-description .desc-body {
  font-size: 0.92rem;
  line-height: 1.75;
  color: #444;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .project-grid { grid-template-columns: 1fr; }
  .tree-panel-body { max-height: 240px; }
  .project-page { padding: 20px 1rem 48px; }
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }
  .project-actions { width: 100%; }
  .project-actions .btn { flex: 1; justify-content: center; }
}
