/* ===== 基础变量 ===== */
: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: 6px;
  --radius-lg: 10px;
  --ui-scale: 0.9;
}

* {
  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.4;
  font-size: 13px;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ===== 密码登录页 ===== */
.login-gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  padding: 32px 20px 48px;
}

.login-gate-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-warning {
  width: 100%;
  text-align: center;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 28px;
}

.login-card {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 36px 32px 32px;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #1e3a8a, #1a56db);
  color: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.login-input.login-input-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.login-error {
  font-size: 13px;
  color: #dc2626;
  margin: 0;
}

.login-btn {
  margin-top: 8px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1e3a8a, #1a56db);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.login-btn:hover {
  opacity: 0.92;
}

.login-btn:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  .login-gate {
    padding: 20px 16px 32px;
  }

  .login-warning {
    font-size: 17px;
    padding: 12px 14px;
    letter-spacing: 1px;
  }

  .login-card {
    padding: 28px 20px 24px;
  }

  .login-title {
    font-size: 18px;
  }
}

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

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

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

.header h1 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-disclaimer {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #fef3c7;
  background: rgba(220, 38, 38, 0.35);
  border: 1px solid rgba(254, 243, 199, 0.5);
  border-radius: 4px;
  padding: 2px 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 1px;
}

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

.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;
}

.btn-logout {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.65);
  color: white;
}

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

.legend-item {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  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: 248px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 64px);
  position: relative;
  transition: grid-template-columns 0.22s ease;
}

body.sidebar-collapsed .main-layout {
  grid-template-columns: 36px minmax(0, 1fr);
}

/* ===== 侧边栏（左侧常驻，可收起） ===== */
.sidebar-rail {
  position: relative;
  min-width: 0;
  height: calc(100vh - 64px);
  z-index: 2;
}

.sidebar {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 100%;
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  padding: 14px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  transition: opacity 0.18s ease, padding 0.22s ease;
}

body.sidebar-collapsed .sidebar {
  opacity: 0;
  padding: 0;
  border-right: none;
  pointer-events: none;
  overflow: hidden;
}

.btn-sidebar-expand {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  padding: 8px 4px;
  border: none;
  border-right: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.12em;
  cursor: pointer;
  z-index: 3;
}

.btn-sidebar-expand:hover {
  background: #eff6ff;
}

body.sidebar-collapsed .btn-sidebar-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.main-content {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
}

.sidebar-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-drawer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-sidebar-action {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.3;
}

.btn-sidebar-action:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #eff6ff;
}

.btn-sidebar-action:disabled {
  opacity: 0.45;
  cursor: default;
}

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

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

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

.status-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  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.registered { background: #2563eb; }
.filter-dot.reserve { background: #8b5cf6; }
.filter-dot.inquiry { background: #f59e0b; }
.filter-dot.listing { 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: 6px;
}

.dept-card {
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 11px;
  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: 16px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  min-height: 0;
}

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

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

.search-box input {
  width: 280px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  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: 14px;
  gap: 12px;
}

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

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

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

.btn-export,
.btn-secondary,
.btn-primary,
.btn-capture {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-export,
.btn-secondary {
  background: var(--color-white);
  border-color: var(--color-border);
  color: var(--color-text);
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: #1648c0;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #93b4f5;
  border-color: #93b4f5;
}

.btn-capture {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.btn-capture:hover {
  background: #ffedd5;
}

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

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

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

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

.stage-stat-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: none;
}

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

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

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

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

.stage-stat-owner {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: #94a3b8;
  text-align: center;
}

.stage-stat-owner.team { color: var(--color-team-accent); }
.stage-stat-owner.intermediary { color: var(--color-intermediary-accent); }
.stage-stat-owner.dcm { color: var(--color-dcm-accent); }

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

.stage-stat-card .help-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  font-size: 8px;
}

.stage-stat-registered.active { border-color: #1d4ed8; background: #dbeafe; }
.stage-stat-reserve.active { border-color: #7c3aed; background: #f5f3ff; }
.stage-stat-inquiry.active { border-color: #d97706; background: #fffbeb; }
.stage-stat-listing.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;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  position: relative;
}

.overview-query-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
}

.overview-query-bar .query-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
  flex: 0 1 130px;
}

.overview-query-bar .query-field span {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.overview-query-bar .query-field input[type="text"],
.overview-query-bar .query-field input[type="date"] {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}

.overview-query-bar .query-field-date {
  flex: 0 1 220px;
  min-width: 200px;
}

.overview-query-bar .query-date-range {
  display: flex;
  align-items: center;
  gap: 4px;
}

.overview-query-bar .query-date-sep {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.overview-query-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.overview-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--color-border);
  background: #f9fafb;
}

.overview-pagination .pagination-info {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.overview-pagination .pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.overview-pagination .pagination-size select {
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 12px;
  padding: 0 4px;
  background: #fff;
}

.overview-pagination .pagination-page {
  font-size: 12px;
  min-width: 48px;
  text-align: center;
}

.overview-table th.th-draggable {
  cursor: grab;
}

.overview-table th.th-dragging {
  opacity: 0.55;
}

.overview-table th.th-drag-over {
  box-shadow: inset 2px 0 0 var(--color-primary);
}

.btn-sm {
  padding: 3px 8px;
  font-size: 12px;
}

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

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

.overview-table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.column-picker {
  position: relative;
}

.btn-column-picker {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-column-picker:hover,
.btn-column-picker[aria-expanded="true"] {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #eff6ff;
}

.column-picker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: min(360px, 80vw);
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 12px;
}

.column-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.column-picker-head strong {
  font-size: 13px;
}

.column-picker-actions {
  display: flex;
  gap: 8px;
}

.btn-link {
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

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

.column-picker-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.column-picker-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1.35;
  padding: 4px 2px;
}

.column-picker-item input {
  margin-top: 2px;
  flex-shrink: 0;
}

.column-picker-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.overview-table-wrapper {
  border: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: scroll;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  min-height: 240px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

.overview-table-wrapper::-webkit-scrollbar {
  height: 12px;
  width: 10px;
}

.overview-table-wrapper::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.overview-table-wrapper::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

.overview-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.overview-table {
  font-size: 11px;
  min-width: 2500px;
  width: max-content;
  table-layout: auto;
}

.overview-table th,
.overview-table td {
  padding: 6px 8px;
  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 .col-sticky.col-check {
  left: 0;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
  box-shadow: none;
  z-index: 3;
}

.overview-table .col-sticky.col-id {
  left: 36px;
  z-index: 3;
}

.overview-table thead .col-sticky.col-check,
.overview-table thead .col-sticky.col-id {
  z-index: 4;
  background: #f9fafb;
}

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

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

.overview-table th {
  position: relative;
  vertical-align: middle;
}

.th-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.th-filter-btn:hover,
.th-filter-btn.is-active {
  color: var(--color-primary);
}

.th-filter-icon {
  font-size: 10px;
  opacity: 0.7;
}

.th-filter-btn.is-active .th-filter-icon {
  color: #dc2626;
  opacity: 1;
}

.th-filter-panel {
  position: fixed;
  z-index: 2000;
  width: 240px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  text-align: left;
  font-weight: 400;
}

.th-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}

.th-filter-panel-actions {
  display: flex;
  gap: 8px;
}

.th-filter-panel-list {
  overflow: auto;
  padding: 6px 8px;
  max-height: 220px;
}

.th-filter-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 2px;
  font-size: 12px;
  cursor: pointer;
}

.th-filter-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-filter-empty {
  font-size: 12px;
  color: var(--color-text-secondary);
  padding: 8px;
}

.th-filter-panel-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--color-border);
}

.btn-sm {
  padding: 4px 10px !important;
  font-size: 12px !important;
}

.overview-table .row-select,
.overview-table #overviewSelectAll {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.overview-table th.col-bond {
  max-width: 220px;
  white-space: nowrap;
  overflow: visible;
}

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

.overview-table td.bond-name-cell {
  max-width: 220px;
}

.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-wrapper.overview-table-wrapper {
  border: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: scroll;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  min-height: 240px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

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

.project-table th {
  background: #f9fafb;
  padding: 8px 10px;
  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: 7px 10px;
  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: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.registered { background: #bfdbfe; color: #1d4ed8; }
.status-badge.reserve { background: #ede9fe; color: #7c3aed; }
.status-badge.inquiry { background: #fef3c7; color: #d97706; }
.status-badge.listing { background: #dcfce7; color: #16a34a; }
.status-badge.duration { background: #d1fae5; color: #059669; }
.status-badge.terminated { background: #f3f4f6; color: #6b7280; }

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

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

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

/* ===== 详情页 ===== */
.content.detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  box-sizing: border-box;
}

.detail-header {
  margin-bottom: 0;
}

.detail-header-sticky {
  flex-shrink: 0;
  position: relative;
  z-index: 40;
  background: var(--color-bg);
  padding: 8px 0 10px;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.detail-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.detail-header-info {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  flex: 1;
  flex-wrap: nowrap;
  overflow: hidden;
}

.detail-bond-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(360px, 32vw);
  flex-shrink: 1;
  min-width: 80px;
}

.detail-header-info .project-id {
  display: inline-flex;
  align-items: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.detail-header-info .status-badge {
  flex-shrink: 0;
  white-space: nowrap;
}

.detail-meta-item {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.detail-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 16px;
  padding-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.detail-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.detail-actions .btn-secondary,
.detail-actions .btn-primary,
.detail-actions .btn-capture {
  padding: 5px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.field-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 12px;
  color: var(--color-text);
  background: #fff;
  font-family: inherit;
  line-height: 1.35;
}

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

.field-control-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-control-row .field-input,
.field-control-row select.field-input {
  flex: 1;
  min-width: 0;
}

.field-unit {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.field-item.field-computed .field-input {
  background: #f1f5f9;
  color: #475569;
}

.field-item.field-empty .field-input::placeholder {
  color: #94a3b8;
}

/* ===== Modal / Toast ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow: auto;
}

.modal-wide {
  max-width: 640px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0 4px;
}

.modal-body {
  padding: 20px;
}

.modal-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}

.form-field span em {
  color: #dc2626;
  font-style: normal;
}

.form-field input,
.form-field select {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.form-field small {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.capture-text {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 36vh;
  overflow: auto;
  font-family: "Cascadia Mono", "Consolas", "PingFang SC", "Microsoft YaHei", monospace;
}

.modal-capture .modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capture-picker {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.capture-picker-head,
.capture-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.capture-picker-head {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}

.capture-picker-head strong,
.capture-preview-head strong {
  font-size: 13px;
}

.capture-picker-actions {
  display: flex;
  gap: 10px;
}

.capture-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
}

.capture-picker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}

.capture-picker-item:hover {
  background: #f1f5f9;
}

.capture-picker-item.is-checked {
  background: #eff6ff;
}

.capture-picker-item input {
  margin: 0;
}

.capture-order {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  color: #fff;
  background: var(--color-primary, #1a56db);
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
}

.capture-order-hint {
  font-size: 11px;
  color: var(--color-text-secondary);
  max-width: 100%;
  line-height: 1.4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 3000;
  box-shadow: var(--shadow-md);
  max-width: 90vw;
}

.toast.success {
  background: #166534;
}

.toast.warn {
  background: #92400e;
}

/* ===== 分区卡片 ===== */
.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;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.section-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* ===== 进度时间轴 ===== */
.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;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.timeline-step:hover .timeline-dot {
  transform: scale(1.08);
}

.timeline-step:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

.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;
}

.timeline-owner {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.2;
  color: #94a3b8;
}

.timeline-owner.team { color: var(--color-team-accent); }
.timeline-owner.intermediary { color: var(--color-intermediary-accent); }
.timeline-owner.dcm { color: var(--color-dcm-accent); }

/* ===== 详情双维度切换 ===== */
.detail-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.view-mode-toggle {
  display: inline-flex;
  padding: 3px;
  background: #f1f5f9;
  border-radius: 10px;
  gap: 2px;
}

.view-mode-btn {
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-mode-btn.active {
  background: var(--color-white);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.view-mode-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* ===== 按进度 × 部门 ===== */
.stage-fields-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 16px;
}

.stage-panel.current {
  border-color: #fca5a5;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.12), var(--shadow-sm);
}

.stage-panel-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: #f8fafc;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.stage-panel.completed .stage-panel-header {
  background: #f0fdf4;
}

.stage-panel.current .stage-panel-header {
  background: #fef2f2;
}

.stage-panel.upcoming .stage-panel-header {
  background: #f8fafc;
}

.stage-panel-left,
.stage-panel-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stage-panel-right {
  flex-shrink: 0;
}

.stage-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: #64748b;
  flex-shrink: 0;
}

.stage-panel.completed .stage-index {
  background: var(--color-primary);
  color: #fff;
}

.stage-panel.current .stage-index {
  background: #dc2626;
  color: #fff;
}

.stage-panel-title {
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stage-state-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  white-space: nowrap;
}

.stage-panel.completed .stage-state-tag {
  background: #dcfce7;
  color: #15803d;
}

.stage-panel.current .stage-state-tag {
  background: #fee2e2;
  color: #dc2626;
}

.stage-field-count {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.stage-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -4px;
}

.stage-panel.expanded .stage-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.stage-panel-body {
  display: none;
  padding: 12px;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.stage-panel.expanded .stage-panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: #f8fafc;
  border-radius: 8px;
}

.stage-dept-block {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.stage-dept-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.stage-dept-block.section-team .stage-dept-header {
  background: var(--color-team-bg);
  border-bottom-color: var(--color-team-border);
}

.stage-dept-block.section-intermediary .stage-dept-header {
  background: var(--color-intermediary-bg);
  border-bottom-color: var(--color-intermediary-border);
}

.stage-dept-block.section-dcm .stage-dept-header {
  background: var(--color-dcm-bg);
  border-bottom-color: var(--color-dcm-border);
}

.stage-dept-count {
  font-size: 12px;
  color: var(--color-text-secondary);
}

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

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

.stage-dept-block.section-team .field-item.field-placeholder {
  background: repeating-linear-gradient(
    -45deg,
    var(--color-team-bg),
    var(--color-team-bg) 8px,
    #ecfdf5 8px,
    #ecfdf5 16px
  );
  border-left: 3px solid var(--color-team-accent);
}

.stage-dept-block.section-intermediary .field-item.field-placeholder {
  background: repeating-linear-gradient(
    -45deg,
    var(--color-intermediary-bg),
    var(--color-intermediary-bg) 8px,
    #fff7ed 8px,
    #fff7ed 16px
  );
  border-left: 3px solid var(--color-intermediary-accent);
}

.stage-dept-block.section-dcm .field-item.field-placeholder {
  background: repeating-linear-gradient(
    -45deg,
    var(--color-dcm-bg),
    var(--color-dcm-bg) 8px,
    #f5f3ff 8px,
    #f5f3ff 16px
  );
  border-left: 3px solid var(--color-dcm-accent);
}

/* ===== 字段网格 ===== */
.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); }

.variety-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: #fafafa;
}

.variety-toolbar {
  display: flex;
  gap: 8px;
}

.variety-hint,
.variety-hint-inline {
  font-size: 12px;
  color: #6b7280;
}

.variety-block {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.variety-block.variety-single {
  border-style: dashed;
}

.variety-block.variety-single .field-grid {
  border-radius: 8px;
}

.variety-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.variety-actions {
  display: inline-flex;
  gap: 6px;
}

.btn-variety-add,
.btn-variety-remove {
  min-width: 28px;
  height: 28px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #111827;
}

.btn-variety-add:hover {
  border-color: #16a34a;
  color: #16a34a;
}

.btn-variety-remove:hover {
  border-color: #dc2626;
  color: #dc2626;
}

.field-item {
  position: relative;
  padding: 10px 12px 18px;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 68px;
}

.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;
  padding-bottom: 2px;
}

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

.field-updated {
  position: absolute;
  right: 8px;
  bottom: 5px;
  font-size: 10px;
  line-height: 1;
  color: #94a3b8;
  opacity: 0.9;
  pointer-events: none;
  white-space: nowrap;
}

.field-item.field-attachment {
  min-height: 92px;
}

.attachment-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-right: 4px;
}

.attachment-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-name.empty {
  color: #cbd5e1;
  font-weight: 400;
}

.btn-attach {
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-primary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-attach:hover {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.tag-project-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
}

.tag-lead {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.tag-distribution {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.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 !important;
}

/* 待部门维护占位要素 */
.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-wrapper {
    max-height: calc(100vh - 300px);
  }
}

@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) {
  .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;
  }

  .header-disclaimer {
    font-size: 11px;
    padding: 2px 8px;
  }

  .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;
  }
}

/* 手机 */
@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: 6px;
  }

  .stage-stat-card {
    padding: 8px 4px;
    min-height: 58px;
  }

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

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

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

  .detail-view-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .view-mode-toggle {
    width: 100%;
  }

  .view-mode-btn {
    flex: 1;
    text-align: center;
  }

  .stage-panel-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .stage-panel-right {
    width: 100%;
    justify-content: space-between;
    padding-left: 34px;
  }

  .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: 0;
  }

  .detail-header-sticky {
    padding: 6px 0 8px;
  }

  .detail-header-bar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .detail-header-info {
    flex-wrap: wrap;
    width: 100%;
  }

  .detail-bond-name {
    max-width: 100%;
    flex-basis: 100%;
  }

  .detail-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .detail-actions .btn-secondary,
  .detail-actions .btn-primary,
  .detail-actions .btn-capture {
    flex: 1 1 calc(50% - 6px);
  }

  .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-wrapper {
    max-height: calc(100vh - 280px);
    min-height: 220px;
  }
}

/* ===== 0717 导航与驾驶舱 ===== */
.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 4px 6px;
}

.primary-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.primary-nav-btn:hover {
  background: #eef2ff;
}

.primary-nav-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.nav-icon {
  opacity: 0.85;
  width: 1.1em;
  text-align: center;
}

.sub-nav {
  display: none;
  padding: 2px 4px 8px 10px;
}

#pmSubNav.open,
#dataSubNav:not(.hidden),
#systemSubNav:not(.hidden) {
  display: block;
}

.sub-nav-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  margin: 2px 0 4px;
  padding-left: 4px;
}

.sub-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  margin-bottom: 0;
}

.sub-nav-btn:hover,
.sub-nav-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-dept-hint {
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
  padding-top: 8px;
}

.content-stack {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.content-nested {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.pm-tabs {
  display: flex;
  gap: 0;
  padding: 8px 16px 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.pm-tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.pm-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.page-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.page-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.cockpit-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.cockpit-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.cockpit-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cockpit-title-row .cockpit-title {
  margin-bottom: 0;
}

.book-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.book-stat-card {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e0e7ff;
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.book-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.15;
}

.book-stat-unit {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.sheet-tabs {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
}

.sheet-tab {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-text-secondary);
}

.sheet-tab.active {
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.calendar-matrix-wrap {
  display: block;
}

.calendar-month-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.cal-matrix {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.cal-matrix-weekdays,
.cal-matrix-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-matrix-weekday {
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}

.cal-matrix-day {
  min-height: 78px;
  padding: 6px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.cal-matrix-day:nth-child(7n) {
  border-right: none;
}

.cal-matrix-day.is-empty {
  background: #f8fafc;
}

.cal-matrix-day.is-today {
  background: #eff6ff;
}

.cal-matrix-day.has-items {
  background: #fffbeb;
}

.cal-matrix-day.is-today.has-items {
  background: #eff6ff;
}

.cal-matrix-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.cal-matrix-day.is-today .cal-matrix-day-num {
  color: var(--color-primary);
}

.cal-matrix-day-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-matrix-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  border: none;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
  padding: 4px 6px;
  cursor: pointer;
  text-align: left;
}

.cal-matrix-item:hover {
  background: #bfdbfe;
}

.cal-matrix-item-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.cal-matrix-item-scale {
  font-size: 10px;
  opacity: 0.85;
}

.cal-matrix-none {
  font-size: 11px;
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .cal-matrix-day {
    min-height: 72px;
    padding: 4px;
  }

  .cal-matrix-item-scale {
    display: none;
  }

  .cal-matrix-weekday {
    padding: 8px 2px;
    font-size: 11px;
  }
}

.cal-card {
  text-align: left;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cal-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.cal-card-date {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.cal-card-date span {
  margin-left: 6px;
}

.cal-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--color-text);
}

.cal-card-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
  border-top: 1px dashed #eef2f7;
}

.cal-card-row label {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.cal-card-row span {
  text-align: right;
  color: var(--color-text);
}

.plan-book-block {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px 20px;
}

.plan-book-block h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.plan-book-block .sheet-tabs {
  margin-bottom: 14px;
}

.perf-detail {
  margin-top: 16px;
}

.perf-detail h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.portrait-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.portrait-side {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}

.notice-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

.contact-actions {
  margin-bottom: 12px;
}

.role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .book-stats {
    grid-template-columns: 1fr;
  }

  .portrait-layout {
    grid-template-columns: 1fr;
  }
}
