/* 项目档案管理系统 - 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  min-height: 100vh;
}

/* 头部 */
.header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  color: #fff;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.35);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 46px; height: 46px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.brand h1 { font-size: 22px; font-weight: 600; }
.brand p { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.header-actions { display: flex; gap: 10px; }

/* 按钮 */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: rgba(255, 255, 255, 0.18); color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.3); }
.btn-plain { background: #e5e7eb; color: #374151; }
.btn-plain:hover { background: #d1d5db; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* 容器 */
.container { max-width: 1200px; margin: 24px auto; padding: 0 24px; }

/* 统计卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.stat-label { font-size: 13px; color: #6b7280; }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 6px; color: #111827; }
.stat-emoji { font-size: 30px; opacity: 0.8; }

/* 图表 */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.chart-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.chart-card h3 { font-size: 15px; margin-bottom: 14px; color: #374151; }
.bar-row { display: flex; align-items: center; margin-bottom: 8px; }
.bar-label { width: 74px; font-size: 13px; color: #4b5563; flex-shrink: 0; }
.bar-track { flex: 1; background: #f3f4f6; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; width: 0; transition: width 0.5s ease; }
.bar-num { width: 36px; text-align: right; font-size: 13px; color: #6b7280; flex-shrink: 0; }

/* 工具栏 */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #1f2937;
  font-family: inherit;
}
.input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12); }
.search-input { flex: 1; min-width: 220px; }
.select-input { width: 128px; }

/* 表格 */
.table-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.project-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.project-table th {
  background: #f9fafb;
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.project-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.project-table tr:hover td { background: #faf9ff; }
.project-table td.path-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
  font-size: 13px;
}
.remark-cell { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6b7280; font-size: 13px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.op-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.op-edit { color: #4f46e5; }
.op-edit:hover { background: #eef2ff; }
.op-del { color: #ef4444; }
.op-del:hover { background: #fef2f2; }
.empty-tip { text-align: center; color: #9ca3af; padding: 36px 0; }

.footer { text-align: center; color: #9ca3af; font-size: 12px; margin: 24px 0 8px; }

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.modal-sm { max-width: 400px; }
.modal h3 { margin-bottom: 16px; font-size: 18px; color: #111827; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.form-row .req { color: #ef4444; }
.form-row .input { width: 100%; }
textarea.input { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-text { color: #4b5563; font-size: 14px; line-height: 1.7; }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #111827;
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; }
.toast.success { background: #059669; }

@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
  .project-table th:nth-child(7), .project-table td:nth-child(7),
  .project-table th:nth-child(8), .project-table td:nth-child(8) { display: none; }
}