/* ===== 基础变量 ===== */
:root {
  --color-primary: #1a56db;
  --color-primary-light: #e8eefb;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #f3f4f6;
  --color-white: #ffffff;

  /* 部门分色 */
  --color-team-bg: #ecfdf5;
  --color-team-border: #a7f3d0;
  --color-team-accent: #059669;

  --color-intermediary-bg: #fff7ed;
  --color-intermediary-border: #fed7aa;
  --color-intermediary-accent: #ea580c;

  --color-dcm-bg: #f5f3ff;
  --color-dcm-border: #ddd6fe;
  --color-dcm-accent: #7c3aed;

  --color-common-bg: #f8fafc;
  --color-common-border: #cbd5e1;
  --color-common-accent: #475569;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ===== 顶部导航 ===== */
.header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1a56db 100%);
  color: white;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

.subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: var(--radius);
}

.nav-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.nav-btn.active {
  background: white;
  color: var(--color-primary);
  font-weight: 600;
}

.dept-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.legend-common { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); }
.legend-team { background: var(--color-team-bg); color: var(--color-team-accent); }
.legend-intermediary { background: var(--color-intermediary-bg); color: var(--color-intermediary-accent); }
.legend-dcm { background: var(--color-dcm-bg); color: var(--color-dcm-accent); }

/* ===== 主布局 ===== */
.main-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 80px);
}

/* ===== 侧边栏 ===== */
.sidebar {
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  padding: 20px 16px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.status-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  text-align: left;
  transition: background 0.15s;
  width: 100%;
}

.status-filter:hover {
  background: var(--color-bg);
}

.status-filter.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-dot.all { background: var(--color-primary); }
.filter-dot.filing { background: #3b82f6; }
.filter-dot.registered { background: #2563eb; }
.filter-dot.prep { background: #f59e0b; }
.filter-dot.launch { background: #ea580c; }
.filter-dot.bookbuilding { background: #dc2626; }
.filter-dot.payment { background: #16a34a; }
.filter-dot.duration { background: #059669; }
.filter-dot.terminated { background: #6b7280; }

.filter-count {
  margin-left: auto;
  background: var(--color-bg);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.status-filter.active .filter-count {
  background: rgba(26, 86, 219, 0.15);
  color: var(--color-primary);
}

.dept-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dept-card {
  padding: 12px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.6;
}

.dept-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.dept-team { background: var(--color-team-bg); border-left: 3px solid var(--color-team-accent); }
.dept-intermediary { background: var(--color-intermediary-bg); border-left: 3px solid var(--color-intermediary-accent); }
.dept-dcm { background: var(--color-dcm-bg); border-left: 3px solid var(--color-dcm-accent); }

/* ===== 内容区 ===== */
.content {
  padding: 24px 32px;
  overflow-y: auto;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.content-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.search-box input {
  width: 320px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

/* ===== 项目总览首页 ===== */
.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}

.overview-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.overview-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.overview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-export:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-export-icon {
  font-size: 14px;
  font-weight: 700;
}

/* 环节数量统计卡片 */
.stage-stats {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stage-stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 88px;
}

.stage-stat-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stage-stat-card.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

.stage-stat-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.stage-stat-card.active .stage-stat-count {
  color: #1e40af;
}

.stage-stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
  text-align: center;
  line-height: 1.3;
}

.stage-stat-card.active .stage-stat-label {
  color: var(--color-primary);
  font-weight: 500;
}

.stage-stat-card .help-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.stage-stat-filing.active { border-color: #2563eb; background: #eff6ff; }
.stage-stat-registered.active { border-color: #1d4ed8; background: #dbeafe; }
.stage-stat-prep.active { border-color: #d97706; background: #fffbeb; }
.stage-stat-launch.active { border-color: #ea580c; background: #fff7ed; }
.stage-stat-bookbuilding.active { border-color: #dc2626; background: #fef2f2; }
.stage-stat-payment.active { border-color: #16a34a; background: #f0fdf4; }
.stage-stat-duration.active { border-color: #059669; background: #ecfdf5; }
.stage-stat-terminated.active { border-color: #6b7280; background: #f9fafb; }

/* 总览明细表 */
.overview-table-section {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.overview-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: #f9fafb;
}

.overview-table-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.overview-table-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.overview-table-wrapper {
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow-x: auto;
}

.overview-table {
  font-size: 12px;
  min-width: 1400px;
}

.overview-table th,
.overview-table td {
  padding: 10px 12px;
  white-space: nowrap;
}

.overview-table .col-sticky {
  position: sticky;
  left: 0;
  background: #f9fafb;
  z-index: 2;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.overview-table tbody .col-sticky {
  background: var(--color-white);
}

.overview-table tbody tr:hover .col-sticky {
  background: #f9fafb;
}

.overview-table .col-bond {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-row {
  cursor: pointer;
}

.cell-empty {
  color: #cbd5e1;
}

/* ===== 项目表格 ===== */
.project-table-wrapper {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.project-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.project-table th {
  background: #f9fafb;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.project-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.project-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.project-table tbody tr:hover {
  background: #f9fafb;
}

.project-table tbody tr:last-child td {
  border-bottom: none;
}

.bond-name-cell {
  max-width: 360px;
  font-weight: 500;
  color: var(--color-primary);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.filing { background: #dbeafe; color: #2563eb; }
.status-badge.registered { background: #bfdbfe; color: #1d4ed8; }
.status-badge.prep { background: #fef3c7; color: #d97706; }
.status-badge.launch { background: #ffedd5; color: #ea580c; }
.status-badge.bookbuilding { background: #fee2e2; color: #dc2626; }
.status-badge.payment { background: #dcfce7; color: #16a34a; }
.status-badge.duration { background: #d1fae5; color: #059669; }
.status-badge.terminated { background: #f3f4f6; color: #6b7280; }

.btn-view {
  padding: 5px 14px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-view:hover {
  background: #1e40af;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
}

/* ===== 详情页 ===== */
.detail-header {
  margin-bottom: 24px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 12px;
  font-weight: 500;
}

.btn-back:hover {
  text-decoration: underline;
}

.detail-title-area .project-id {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-title-area h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}

.detail-issuer {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.detail-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ===== 分区卡片 ===== */
.section {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.section-header h3 {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 20px;
}

.badge-common { background: #f1f5f9; color: var(--color-common-accent); }
.badge-team { background: var(--color-team-bg); color: var(--color-team-accent); }
.badge-intermediary { background: var(--color-intermediary-bg); color: var(--color-intermediary-accent); }
.badge-dcm { background: var(--color-dcm-bg); color: var(--color-dcm-accent); }

.section-common .section-header { background: var(--color-common-bg); }
.section-team .section-header { background: var(--color-team-bg); border-bottom-color: var(--color-team-border); }
.section-intermediary .section-header { background: var(--color-intermediary-bg); border-bottom-color: var(--color-intermediary-border); }
.section-dcm .section-header { background: var(--color-dcm-bg); border-bottom-color: var(--color-dcm-border); }

.section-header-compact {
  padding: 12px 20px;
}

.section-header-compact h3 {
  font-size: 14px;
}

/* ===== 进度时间轴 ===== */
.progress-timeline {
  display: flex;
  padding: 16px 20px;
  gap: 0;
  overflow-x: auto;
  background: var(--color-common-bg);
}

.timeline-step {
  flex: 1;
  min-width: 72px;
  text-align: center;
  position: relative;
}

.timeline-step::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}

.timeline-step:last-child::after {
  display: none;
}

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 11px;
  font-weight: 600;
  position: relative;
  z-index: 1;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.timeline-step.completed .timeline-dot {
  background: var(--color-primary);
  color: white;
}

.timeline-step.completed::after {
  background: var(--color-primary);
}

.timeline-step.current .timeline-dot {
  background: #dc2626;
  color: white;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.timeline-step.current .timeline-label {
  color: #dc2626;
  font-weight: 600;
}

.timeline-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.3;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}

/* ===== 字段网格 ===== */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--color-border);
}

.section-team .field-grid { background: var(--color-team-border); }
.section-intermediary .field-grid { background: var(--color-intermediary-border); }
.section-dcm .field-grid { background: var(--color-dcm-border); }

.field-item {
  padding: 14px 18px;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
}

.section-team .field-item { background: var(--color-team-bg); }
.section-intermediary .field-item { background: var(--color-intermediary-bg); }
.section-dcm .field-item { background: var(--color-dcm-bg); }

.field-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-all;
}

.field-value.empty {
  color: #cbd5e1;
  font-weight: 400;
}

.pending-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.pending-none {
  background: #f3f4f6;
  color: #6b7280;
}

.pending-team {
  background: var(--color-team-bg);
  color: var(--color-team-accent);
  border: 1px dashed var(--color-team-accent);
}

.pending-intermediary {
  background: var(--color-intermediary-bg);
  color: var(--color-intermediary-accent);
  border: 1px dashed var(--color-intermediary-accent);
}

.pending-dcm {
  background: var(--color-dcm-bg);
  color: var(--color-dcm-accent);
  border: 1px dashed var(--color-dcm-accent);
}

/* ===== 帮助图标 & 悬浮提示 ===== */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
  transition: background 0.15s;
}

.help-icon:hover {
  background: var(--color-primary);
  color: white;
}

.tooltip {
  position: fixed;
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 320px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: var(--shadow-md);
}

.tooltip.visible {
  opacity: 1;
}

/* ===== 响应式 ===== */

/* 侧边栏切换按钮 - 默认桌面隐藏 */
.btn-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 13px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hamburger-icon {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 1px;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.hamburger-icon::before { top: -5px; }
.hamburger-icon::after { top: 5px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
}

/* 待部门维护占位要素 */
.field-item.field-placeholder {
  border: 1px dashed var(--color-border);
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(0, 0, 0, 0.02) 4px,
    rgba(0, 0, 0, 0.02) 8px
  );
}

.section-team .field-item.field-placeholder {
  border-color: var(--color-team-accent);
  background: repeating-linear-gradient(
    -45deg,
    var(--color-team-bg),
    var(--color-team-bg) 4px,
    rgba(5, 150, 105, 0.06) 4px,
    rgba(5, 150, 105, 0.06) 8px
  );
}

.section-intermediary .field-item.field-placeholder {
  border-color: var(--color-intermediary-accent);
  background: repeating-linear-gradient(
    -45deg,
    var(--color-intermediary-bg),
    var(--color-intermediary-bg) 4px,
    rgba(234, 88, 12, 0.06) 4px,
    rgba(234, 88, 12, 0.06) 8px
  );
}

.section-dcm .field-item.field-placeholder {
  border-color: var(--color-dcm-accent);
  background: repeating-linear-gradient(
    -45deg,
    var(--color-dcm-bg),
    var(--color-dcm-bg) 4px,
    rgba(124, 58, 237, 0.06) 4px,
    rgba(124, 58, 237, 0.06) 8px
  );
}

.field-item.field-placeholder .field-value.empty {
  color: var(--color-text-secondary);
  font-style: italic;
}

/* 平板横屏 / 小桌面 */
@media (max-width: 1400px) {
  .stage-stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .overview-table {
    min-width: 1200px;
  }
}

@media (max-width: 1200px) {
  .header {
    padding: 14px 20px;
  }

  .content {
    padding: 20px 24px;
  }

  .stage-stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .field-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* 平板竖屏 */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .btn-sidebar-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-md);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
  }

  .header-brand {
    flex: 1;
    min-width: 0;
  }

  .header-brand h1 {
    font-size: 17px;
  }

  .subtitle {
    font-size: 12px;
  }

  .logo {
    width: 40px;
    height: 40px;
    font-size: 18px;
    flex-shrink: 0;
  }

  .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: auto;
    gap: 10px;
  }

  .dept-legend {
    display: none;
  }

  .search-box input {
    width: 100%;
    min-width: 0;
  }

  .overview-header {
    flex-direction: column;
  }

  .overview-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .overview-actions .search-box {
    flex: 1;
    min-width: 180px;
  }

  .stage-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .content-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .project-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .project-table {
    min-width: 960px;
  }

  .detail-title-area h2 {
    font-size: 18px;
  }
}

/* 手机 */
@media (max-width: 768px) {
  .header {
    padding: 10px 12px;
  }

  .header-brand .subtitle {
    display: none;
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: stretch;
  }

  .nav-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
  }

  .btn-sidebar-toggle .toggle-label {
    display: none;
  }

  .content {
    padding: 16px 12px;
  }

  .stage-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stage-stat-card {
    padding: 12px 6px;
    min-height: 76px;
  }

  .stage-stat-count {
    font-size: 22px;
  }

  .stage-stat-label {
    font-size: 11px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .progress-timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .timeline-step::after {
    display: none;
  }

  .timeline-step {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    min-width: auto;
    width: 100%;
  }

  .timeline-dot {
    margin: 0;
    flex-shrink: 0;
  }

  .timeline-label {
    justify-content: flex-start;
  }

  .overview-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-export {
    justify-content: center;
  }

  .overview-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
  }

  .detail-header {
    margin-bottom: 16px;
  }

  .section-header {
    padding: 12px 14px;
  }

  .section-header h3 {
    flex-wrap: wrap;
    font-size: 14px;
  }

  .field-item {
    padding: 12px 14px;
    min-height: 64px;
  }

  .project-table th,
  .project-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .bond-name-cell {
    max-width: 200px;
  }
}

/* 超小屏手机 */
@media (max-width: 480px) {
  .stage-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .header h1 {
    font-size: 15px;
  }

  .overview-table {
    min-width: 900px;
  }
}
