/* ============================================================
   项目一览表 — UI模板/项目一览表/code.html 1:1 桌面样式
   作用域：#project-overview-table（不影响其它 section）
   ============================================================ */

#project-overview-table.pot-page {
  --pot-primary: #2563eb;
  --pot-secondary: #059669;
  --pot-surface: #f7f9fb;
  --pot-card: #ffffff;
  --pot-border: #c3c6d7;
  --pot-text: #191c1e;
  --pot-text-muted: #434655;
  --pot-outline: #737686;
  --pot-error: #dc2626;
  --pot-error-bg: #fee2e2;
  background: var(--pot-surface);
  margin: 0;
  padding: 0;
  min-height: auto;
  color: var(--pot-text);
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
}

/* 与其它 section 一致：非激活时强制隐藏 */
#project-overview-table.section:not(.active) {
  display: none !important;
}

#project-overview-table .pot-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#project-overview-table .pot-page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--pot-text);
}

#project-overview-table .pot-page-subtitle {
  margin: 0;
  color: var(--pot-text-muted);
  font-size: 14px;
}

#project-overview-table .pot-page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#project-overview-table .pot-tab-group {
  display: flex;
  background: #eceef0;
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
}

#project-overview-table .pot-tab {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pot-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

#project-overview-table .pot-tab.active {
  background: #fff;
  color: var(--pot-primary);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

#project-overview-table .pot-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--pot-border);
  border-radius: 8px;
  background: #fff;
  color: var(--pot-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

#project-overview-table .pot-btn-outline:hover {
  background: #eceef0;
}

#project-overview-table .pot-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--pot-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

#project-overview-table .pot-btn-primary:hover {
  opacity: 0.92;
}

/* 顶部四统计卡 */
#project-overview-table .pot-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
  #project-overview-table .pot-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  #project-overview-table .pot-stats-grid { grid-template-columns: 1fr; }
}

#project-overview-table .pot-stat-card {
  background: var(--pot-card);
  border: 1px solid var(--pot-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#project-overview-table .pot-stat-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

#project-overview-table .pot-stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pot-text-muted);
}

#project-overview-table .pot-stat-icon {
  font-size: 20px;
  color: var(--pot-primary);
  line-height: 1;
}

#project-overview-table .pot-stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pot-text);
  font-variant-numeric: tabular-nums;
}

#project-overview-table .pot-stat-value--profit {
  color: var(--pot-secondary);
}

#project-overview-table .pot-stat-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--pot-text-muted);
}

#project-overview-table .pot-stat-hint--warn {
  color: var(--pot-error);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 全公司汇总条（JS 注入） */
#project-overview-table .pot-company-summary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  grid-column: 1 / -1;
}

#project-overview-table .pot-company-summary h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--pot-text);
}

#project-overview-table .pot-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

#project-overview-table .pot-summary-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

#project-overview-table .pot-summary-cell {
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

#project-overview-table .pot-summary-cell__label {
  font-size: 11px;
  color: var(--pot-text-muted);
  margin-bottom: 4px;
}

#project-overview-table .pot-summary-cell__value {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 项目明细区 */
#project-overview-table .pot-projects-section {
  margin-bottom: 1.5rem;
}

#project-overview-table .pot-projects-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#project-overview-table .pot-projects-section__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--pot-text);
}

#project-overview-table .pot-view-toggle {
  display: flex;
  gap: 4px;
}

#project-overview-table .pot-view-btn {
  border: none;
  background: #eceef0;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

#project-overview-table .pot-view-btn.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

#project-overview-table .pot-projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

#project-overview-table .pot-projects-grid.list-view {
  grid-template-columns: 1fr;
}

@media (max-width: 1400px) {
  #project-overview-table .pot-projects-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  #project-overview-table .pot-projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  #project-overview-table .pot-projects-grid { grid-template-columns: 1fr; }
}

/* 项目卡片 — 4 列布局下按比例缩小（约 75% 量级） */
#project-overview-table .pot-project-card {
  background: var(--pot-card);
  border: 1px solid var(--pot-border);
  border-radius: 10px;
  padding: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#project-overview-table .pot-project-card:hover {
  border-color: var(--pot-primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

#project-overview-table .pot-project-card--risk {
  border: 2px solid rgba(220, 38, 38, 0.25);
  background: rgba(254, 226, 226, 0.15);
}

#project-overview-table .pot-project-card--warn {
  border-color: rgba(245, 158, 11, 0.5);
}

#project-overview-table .pot-project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}

#project-overview-table .pot-project-name {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 3px;
  color: var(--pot-text);
  line-height: 1.3;
}

#project-overview-table .pot-project-code {
  font-size: 11px;
  color: var(--pot-outline);
  font-family: ui-monospace, "JetBrains Mono", monospace;
}

#project-overview-table .pot-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

#project-overview-table .pot-status-badge--active {
  background: rgba(5, 150, 105, 0.1);
  color: var(--pot-secondary);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

#project-overview-table .pot-status-badge--planning {
  background: rgba(37, 99, 235, 0.1);
  color: var(--pot-primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

#project-overview-table .pot-status-badge--risk {
  background: var(--pot-error);
  color: #fff;
}

#project-overview-table .pot-status-badge--warn {
  background: #f59e0b;
  color: #fff;
}

#project-overview-table .pot-financial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

#project-overview-table .pot-fin-cell {
  background: #f2f4f6;
  padding: 6px;
  border-radius: 5px;
}

#project-overview-table .pot-fin-cell--highlight {
  background: var(--pot-secondary);
  color: #fff;
}

#project-overview-table .pot-fin-cell--highlight-warn {
  background: rgba(5, 150, 105, 0.4);
  color: var(--pot-secondary);
}

#project-overview-table .pot-fin-cell--highlight-danger {
  background: var(--pot-error);
  color: #fff;
}

#project-overview-table .pot-fin-cell__label {
  display: block;
  font-size: 10px;
  color: var(--pot-text-muted);
  margin-bottom: 3px;
}

#project-overview-table .pot-fin-cell--highlight .pot-fin-cell__label,
#project-overview-table .pot-fin-cell--highlight-danger .pot-fin-cell__label {
  color: rgba(255, 255, 255, 0.85);
}

#project-overview-table .pot-fin-cell__value {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#project-overview-table .pot-fin-cell__value.positive { color: var(--pot-secondary); }
#project-overview-table .pot-fin-cell__value.negative { color: var(--pot-error); }

#project-overview-table .pot-project-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--pot-border);
  font-size: 11px;
  color: var(--pot-text-muted);
}

#project-overview-table .pot-project-card__foot--risk {
  border-top-color: rgba(220, 38, 38, 0.15);
  color: var(--pot-error);
  font-weight: 600;
}

#project-overview-table .pot-link-btn {
  border: none;
  background: none;
  color: var(--pot-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
}

#project-overview-table .pot-link-btn--danger { color: var(--pot-error); }

#project-overview-table .pot-milestone-btn {
  border: none;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin-right: 6px;
}

#project-overview-table .pot-project-detail {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--pot-border);
  font-size: 12px;
  color: var(--pot-text-muted);
}

#project-overview-table .pot-project-detail.open {
  display: block;
}

#project-overview-table .pot-cost-bar {
  height: 6px;
  background: #eceef0;
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 4px;
}

#project-overview-table .pot-cost-bar__fill {
  height: 100%;
  border-radius: 3px;
}

#project-overview-table .pot-cost-bar__fill.ok { background: linear-gradient(90deg, #10b981, #059669); }
#project-overview-table .pot-cost-bar__fill.warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
#project-overview-table .pot-cost-bar__fill.bad { background: linear-gradient(90deg, #ef4444, #dc2626); }

#project-overview-table .pot-cost-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--pot-outline);
}

#project-overview-table .pot-extra-costs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  #project-overview-table .pot-extra-costs { grid-template-columns: repeat(2, 1fr); }
}

#project-overview-table .pot-extra-cost {
  text-align: center;
  padding: 5px;
  background: #f7f9fb;
  border-radius: 5px;
  font-size: 10px;
}

#project-overview-table .pot-extra-cost strong {
  display: block;
  font-size: 11px;
  color: var(--pot-text);
}

/* 空状态 */
#project-overview-table .pot-empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  background: var(--pot-card);
  border: 2px dashed var(--pot-border);
  border-radius: 16px;
  text-align: center;
  margin-bottom: 1.5rem;
}

#project-overview-table .pot-empty-state.visible {
  display: flex;
}

#project-overview-table .pot-empty-icon {
  width: 80px;
  height: 80px;
  background: #eceef0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 1rem;
}

#project-overview-table .pot-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

#project-overview-table .pot-empty-state p {
  color: var(--pot-text-muted);
  max-width: 360px;
  margin: 0 0 1rem;
}

/* 底部图表区（模板静态装饰） */
#project-overview-table .pot-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  #project-overview-table .pot-footer-grid { grid-template-columns: 1fr; }
}

#project-overview-table .pot-chart-panel {
  background: var(--pot-card);
  border: 1px solid var(--pot-border);
  border-radius: 12px;
  padding: 16px;
}

#project-overview-table .pot-chart-panel h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}

#project-overview-table .pot-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 120px;
  padding: 0 8px 8px;
}

#project-overview-table .pot-chart-bar {
  flex: 1;
  background: rgba(37, 99, 235, 0.2);
  border-radius: 4px 4px 0 0;
  min-height: 20%;
  transition: background 0.2s;
}

#project-overview-table .pot-chart-bar:hover { background: rgba(37, 99, 235, 0.4); }
#project-overview-table .pot-chart-bar.primary {
  background: var(--pot-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#project-overview-table .pot-chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 8px 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--pot-text-muted);
  text-transform: uppercase;
}

#project-overview-table .pot-announce-panel {
  background: var(--pot-primary);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
  position: relative;
  overflow: hidden;
}

#project-overview-table .pot-announce-panel h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}

#project-overview-table .pot-announce-panel p {
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.55;
  margin: 0;
}

#project-overview-table .pot-announce-btn {
  margin-top: 16px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

#project-overview-table .pot-announce-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
