/* ═══════════════════════════════════════════════════════════
   projects.css — 项目页样式
   ═══════════════════════════════════════════════════════════ */

/* ── 页面布局 ── */
.proj-layout {
  display: flex;
  gap: 7rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 5rem 3rem 4rem;
  min-height: 100vh;
  box-sizing: border-box;
}

.proj-main {
  flex: 1;
  min-width: 0;
  width: calc(100% - 400px);
}

/* ── 侧边栏 ── */
.proj-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: calc(4.4rem + 2rem);
  height: fit-content;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.proj-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 4px 28px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.proj-avatar-wrap::after {
  content: 'Avatar';
  position: absolute;
  color: rgba(0,0,0,.20);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  pointer-events: none;
  opacity: 0;
}

.proj-avatar-wrap.failed::after {
  opacity: 1;
}

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

.proj-avatar-wrap.failed .proj-avatar {
  visibility: hidden;
}

.proj-name {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: .5rem;
}

.proj-title {
  font-size: .85rem;
  color: var(--text-sub);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.proj-title svg {
  opacity: .6;
}

/* ── 统计数据 ── */
.proj-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.proj-stat-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  align-items: left;
  text-align: left;
}

.proj-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.proj-stat-label {
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: .05em;
}

/* ── Bio ── */
.proj-bio {
  font-size: .875rem;
  line-height: 1.75;
  color: var(--text-sub);
  margin-bottom: 1.75rem;
}

.proj-bio a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}

.proj-bio a:hover {
  border-bottom-color: var(--text);
}

/* ── Subscribe ── */
.proj-subscribe {
  margin-bottom: 1.75rem;
  width: 100%;
}

.proj-subscribe-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: .75rem;
  display: block;
}

.proj-subscribe-form {
  display: flex;
  gap: .5rem;
}

.proj-subscribe-input {
  flex: 1;
  padding: .75rem .85rem;
  font-size: .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  outline: none;
  transition: border-color .25s;
}

.proj-subscribe-input:focus {
  border-color: rgba(0,0,0,.25);
}

.proj-subscribe-btn {
  padding: .75rem 1.25rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}

.proj-subscribe-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

.proj-social {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.proj-social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-sub);
  text-decoration: none;
  transition: all .25s;
}

.proj-social-link:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--white);
}

.proj-action-btn {
  width: 100%;
  padding: .85rem 1.25rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--white);
  background: var(--text);
  border: none;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}

.proj-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ── Header ── */
.proj-header {
  margin-bottom: 3rem;
}

.proj-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: .75rem;
}

.proj-header p {
  font-size: 1.1rem;
  color: var(--text-sub);
  line-height: 1.6;
}

/* ── Grid ── */
.proj-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 400px;
}

.proj-loading {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.proj-loading-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.proj-loading-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.proj-loading-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg);
  flex-shrink: 0;
}

.proj-loading-title {
  flex: 1;
  height: 1.25rem;
  background: var(--bg);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.proj-loading-mrr {
  width: 60px;
  height: 1.1rem;
  background: var(--bg);
  border-radius: 4px;
  flex-shrink: 0;
}

.proj-loading-desc {
  height: 0.9rem;
  background: var(--bg);
  border-radius: 4px;
  width: 70%;
}

.proj-loading-data {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.proj-loading-chart {
  height: 60px;
  background: var(--bg);
  border-radius: 4px;
  margin-bottom: 1rem;
}

.proj-loading-stats {
  display: flex;
  gap: 2.5rem;
}

.proj-loading-stat {
  flex: 1;
}

.proj-loading-stat-value {
  height: 1.1rem;
  background: var(--bg);
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.proj-loading-stat-label {
  height: 0.65rem;
  background: var(--bg);
  border-radius: 4px;
  width: 60%;
}

.proj-empty {
  font-size: .9rem;
  color: var(--text-sub);
  padding: 4rem;
  text-align: center;
}

/* ── Card ── */
.proj-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  transition: all .3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.proj-card--featured {
  background: #ffffff;
}

.proj-card-content {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  min-height: 56px;
}

.proj-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.proj-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s;
}

.proj-card-icon img.loaded {
  opacity: 1;
}

.proj-card-icon-placeholder {
  position: absolute;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: .05em;
}

.proj-card-main {
  flex: 1;
  min-width: 0;
}

.proj-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.proj-card-info {
  flex: 1;
  min-width: 0;
}

.proj-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}

.proj-card-link {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  padding: 2rem;
  margin: -2rem -2rem 0;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.proj-card-link:hover {
  background-color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.proj-card-desc {
  font-size: .9rem;
  color: #888888;
  line-height: 1.5;
}

.proj-card-mrr {
  font-size: .85rem;
  font-weight: 600;
  color: #66a366;
  letter-spacing: -.01em;
  flex-shrink: 0;
}

/* ── Card Data Section ── */
.proj-card-data {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.proj-card-stats-row {
  display: flex;
  gap: 2.5rem;
}

.proj-card-stat-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.proj-card-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.proj-card-stat-value.blurred {
  filter: blur(6px);
  -webkit-filter: blur(6px);
  position: relative;
  transition: filter 0.3s ease;
}

.proj-card-stat-value.blurred:hover {
  filter: blur(4px);
  -webkit-filter: blur(4px);
}

.proj-card-stat-value.blurred::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -4px;
  right: -4px;
  bottom: -2px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 6px;
  opacity: 0.8;
}

.proj-card-stat-label {
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Chart Styles (SVG Area Chart) ── */
.proj-chart {
  margin-bottom: 1.25rem;
  position: relative;
  padding-left: 3.5rem;
}

.proj-chart-grid {
  position: absolute;
  top: 0;
  left: 3rem;
  right: 0;
  height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.proj-chart-grid-line {
  width: 100%;
  height: 1px;
  background: #e5e5e5;
  opacity: 0.8;
}

.proj-chart-y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 24px;
  width: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 0.5rem;
  height: 60px;
}

.proj-chart-y-axis span {
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: -1px;
}

.proj-chart-area {
  height: 60px;
  position: relative;
}

.proj-chart-canvas {
  width: 100%;
  height: 100%;
}

.proj-chart-area-fill {
  transition: opacity .3s;
}

.proj-chart:hover .proj-chart-area-fill {
  opacity: 0.8;
}

.proj-chart-labels {
  display: flex;
  gap: .25rem;
  margin-top: .5rem;
  padding-left: 0.5rem;
}

.proj-chart-label {
  flex: 1;
  text-align: center;
  font-size: .6rem;
  color: var(--text-sub);
  letter-spacing: .02em;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .proj-layout {
    flex-direction: column;
    gap: 3rem;
    padding: 3rem 1.5rem 3rem;
  }

  .proj-main {
    width: 100%;
  }

  .proj-sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
  }

  .proj-avatar-wrap {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
  }

  .proj-sidebar > div:not(.proj-avatar-wrap) {
    flex: 1;
    min-width: 200px;
  }

  .proj-stats,
  .proj-bio,
  .proj-subscribe,
  .proj-social,
  .proj-action-btn {
    display: none;
  }

  .proj-header h1 {
    font-size: 1.75rem;
  }

  .proj-card-content {
    flex-direction: column;
    gap: 1rem;
  }

  .proj-card-main {
    width: 100%;
  }

  .proj-card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .proj-card-stats-row {
    gap: 1.5rem;
  }
}