/* ========================================
 * project.css - 项目模块样式（列表 + 详情共用）
 * ======================================== */

/* ---- 筛选Tab栏 ---- */
.filter-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 16px;
  background: var(--bg-card, #1a1a2e);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-overflow-scrolling: touch;
}

/* 隐藏滚动条 */
.filter-tabs::-webkit-scrollbar {
  display: none;
}

/* 单个筛选Tab项 */
.filter-tab {
  padding: 10px 16px;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #888);
  transition: color 0.2s, border-color 0.2s;
  user-select: none;
  flex-shrink: 0;
}

.filter-tab:hover {
  color: var(--text-secondary, #ccc);
}

/* 选中态 */
.filter-tab.active {
  color: var(--neon-cyan, #00f0ff);
  border-bottom-color: var(--neon-cyan, #00f0ff);
}

/* ---- 排序栏 ---- */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  background: var(--bg-card, #1a1a2e);
}

.sort-bar-label {
  flex-shrink: 0;
  margin-right: 4px;
}

/* 排序按钮 */
.sort-btn {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--text-muted, #888);
  cursor: pointer;
  font-size: 0.75rem;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.sort-btn:hover {
  color: var(--text-secondary, #ccc);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 排序按钮选中态 */
.sort-btn.active {
  color: var(--neon-cyan, #00f0ff);
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.06);
}

/* ---- 项目卡片列表容器 ---- */
.project-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- 项目卡片 ---- */
.project-card {
  background: var(--bg-card, #1a1a2e);
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.2s;
  position: relative;
}

.project-card:active {
  transform: scale(0.985);
}

/* 状态指示 - 进行中 */
.project-card[data-status="active"] {
  border-left-color: var(--neon-cyan, #00f0ff);
}

/* 状态指示 - 已完成 */
.project-card[data-status="completed"] {
  border-left-color: var(--success, #00e676);
}

/* 状态指示 - 待启动 */
.project-card[data-status="pending"] {
  border-left-color: var(--text-muted, #888);
}

/* 状态指示 - 风险 */
.project-card[data-status="risk"] {
  border-left-color: var(--danger, #ff5252);
}

/* 项目名称 */
.project-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #eee);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 元信息行 */
.project-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  align-items: center;
}

/* 项目类型标签 */
.project-type-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan, #00f0ff);
  line-height: 1.6;
}

/* 状态标签 */
.project-status-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  line-height: 1.6;
}

.project-status-tag.active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan, #00f0ff);
}

.project-status-tag.completed {
  background: rgba(0, 230, 118, 0.1);
  color: var(--success, #00e676);
}

.project-status-tag.pending {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #888);
}

.project-status-tag.risk {
  background: rgba(255, 82, 82, 0.1);
  color: var(--danger, #ff5252);
}

/* ---- 进度条区域 ---- */
.project-card-progress {
  margin: 10px 0 8px;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--neon-cyan, #00f0ff);
  transition: width 0.4s ease;
}

/* 已完成进度条颜色 */
.project-card[data-status="completed"] .progress-bar-fill {
  background: var(--success, #00e676);
}

/* 风险进度条颜色 */
.project-card[data-status="risk"] .progress-bar-fill {
  background: var(--danger, #ff5252);
}

.progress-text {
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  margin-top: 4px;
  text-align: right;
}

/* ---- 项目经理 ---- */
.project-manager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary, #ccc);
}

.project-manager .avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: var(--neon-cyan, #00f0ff);
  flex-shrink: 0;
}

/* ---- 日期范围 ---- */
.project-date-range {
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  margin-top: 6px;
}

/* ---- 底部统计 ---- */
.project-card-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.project-card-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.project-card-stats .stat-value {
  color: var(--text-secondary, #ccc);
  font-weight: 500;
}

/* ---- 预算信息 ---- */
.project-budget {
  font-size: 0.8rem;
  color: var(--text-secondary, #ccc);
  font-weight: 500;
}

/* ---- 骨架屏卡片 ---- */
.skeleton-card {
  background: var(--bg-card, #1a1a2e);
  border-radius: 10px;
  padding: 14px 16px;
}

.skeleton-card .skeleton {
  margin-bottom: 10px;
}

.skeleton-card .skeleton:last-child {
  margin-bottom: 0;
}

/* ---- 空状态 ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted, #888);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.85rem;
  text-align: center;
}

/* ---- 搜索框容器 ---- */
.project-search-bar {
  padding: 12px 16px;
  background: var(--bg-card, #1a1a2e);
}

.project-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #eee);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.project-search-input::placeholder {
  color: var(--text-muted, #888);
}

.project-search-input:focus {
  border-color: rgba(0, 240, 255, 0.3);
}

.project-search-wrapper {
  position: relative;
}

.project-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  pointer-events: none;
}

/* ========================================
 * 项目详情页样式
 * ======================================== */

/* ---- 顶部概览区 ---- */
.detail-overview {
  padding: var(--space-lg);
  background: var(--bg-card, rgba(255, 255, 255, 0.07));
}

/* 环形进度 + 状态信息 */
.detail-progress-section {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.detail-ring {
  flex-shrink: 0;
}

.detail-status-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.6;
}

.detail-type-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  background: rgba(168, 85, 247, 0.12);
  color: var(--neon-purple, #a855f7);
  line-height: 1.6;
}

/* ---- 6个指标卡片（2行3列网格） ---- */
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-metric-card {
  text-align: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.3;
}

.detail-metric-label {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
}

/* ---- 详情Tab内容区 ---- */
.detail-tab-overview {
  padding: var(--space-lg);
}

/* ---- 区块标题 ---- */
.detail-section {
  margin-bottom: var(--space-xl, 24px);
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: var(--space-md, 12px);
}

/* ---- 基本信息卡片 ---- */
.detail-info-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--space-lg, 16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.detail-info-row:last-child {
  border-bottom: none;
}

.detail-info-label {
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.detail-info-value {
  color: var(--text-secondary, #cbd5e1);
  text-align: right;
  max-width: 60%;
  word-break: break-all;
}

/* 描述行改为纵向排列 */
.detail-info-desc {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.detail-info-desc .detail-info-value {
  text-align: left;
  max-width: 100%;
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ---- 里程碑时间轴（覆盖base.css默认样式） ---- */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.timeline-item {
  position: relative;
  padding-bottom: 18px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* 覆盖base.css的默认圆点伪元素 */
.timeline-item::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: -29px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-title {
  font-size: 0.82rem;
  color: var(--text-primary, #f1f5f9);
  font-weight: 500;
  line-height: 1.4;
}

.timeline-date {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

.timeline-desc {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  opacity: 0.7;
  margin-top: 2px;
  line-height: 1.4;
}

/* ---- 项目成员列表 ---- */
.detail-member-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.detail-member-item {
  display: flex;
  align-items: center;
  gap: var(--space-md, 12px);
  padding: 10px var(--space-lg, 16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.detail-member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.detail-member-name {
  font-size: 0.82rem;
  color: var(--text-primary, #f1f5f9);
  font-weight: 500;
}

.detail-member-dept {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
}

/* ---- 详情页Tab栏滚动支持 ---- */
#detail-tab-bar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#detail-tab-bar::-webkit-scrollbar {
  display: none;
}

#detail-tab-bar .tab-item {
  flex: none;
  padding: 12px 14px;
  min-width: auto;
}
