/**
 * 项目时间节点执行表 - 样式文件
 * 深色侧边栏 + 浅色主题
 */

/* ========== CSS变量定义 ========== */
:root {
  --bg-body: #f0f2f5;
  --bg-card: #ffffff;
  --bg-hover: #f8f9fc;
  --bg-input: #fafbfc;
  --border-light: #e5e7eb;
  --border-focus: #6366f1;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-yellow: #eab308;
  --sidebar-bg: #1f2937;
  --sidebar-bg-hover: #374151;
  --sidebar-text: #f3f4f6;
  --sidebar-text-muted: #9ca3af;
  --sidebar-active-bg: rgba(75, 85, 99, 0.4);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ========== 基础重置 ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
}

body {
  background: var(--bg-body);
  padding: 0;
  font-size: 14px;
  min-height: 100vh;
  color: var(--text-primary);
}

/* ========== 布局 ========== */
.layout {
  max-width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  align-items: stretch;
  min-height: 100vh;
  transition: grid-template-columns 0.3s ease;
}

/* 显示右侧详情面板时的布局 */
.layout.with-detail-panel {
  grid-template-columns: 280px 1fr 260px;
}

/* ========== 侧边栏 ========== */
.sidebar {
  background: var(--sidebar-bg);
  border-radius: 0;
  box-shadow: none;
  padding: 1.25rem 1rem;
  font-size: 0.8rem;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--sidebar-text-muted);
  /* display: flex; */
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  flex-shrink: 0;
}

/* 文件夹全部折叠/展开按钮 */
.folder-toggle-all-btn {
  background: transparent;
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: var(--sidebar-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  opacity: 0.7;
}

.folder-toggle-all-btn:hover {
  background: var(--sidebar-bg-hover);
  border-color: rgba(156, 163, 175, 0.5);
  color: var(--sidebar-text);
  opacity: 1;
}

.folder-toggle-all-btn:active {
  transform: scale(0.95);
}

/* 文件夹区域：包含文件夹列表和按钮的容器 */
.sidebar-folder-section {
  height: 30%;
  display: flex;
  display: none;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* 文件夹容器 */
#folder-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 0.5rem;
  padding-right: 0.25rem;
  min-height: 0;
}

/* 文件夹区域的按钮 */
.sidebar-folder-section .add-folder-btn,
.sidebar-folder-section .add-project-btn {
  flex-shrink: 0;
  margin-top: 0.5rem;
}

/* 文件夹 */
.folder {
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.5rem;
  background: transparent;
}

.folder-header {
  padding: 0.6rem 0.75rem;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  border-radius: var(--radius-md);
}

.folder-header:hover {
  background: var(--sidebar-bg-hover);
}

.folder-header span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--sidebar-text);
  font-weight: 500;
}

.folder-icon {
  font-size: 1rem;
}

.folder-toggle-indicator {
  color: var(--sidebar-text-muted);
  font-size: 14px;
}

.folder-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.folder-delete-btn {
  background: transparent;
  border: none;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s ease;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-header:hover .folder-delete-btn {
  opacity: 1;
}

.folder-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  opacity: 1;
}

.folder-list {
  list-style: none;
  max-height: 250px;
  overflow-y: auto;
  transition: max-height 0.25s ease;
  padding: 0.25rem 0;
}

.folder-list.collapsed {
  max-height: 0;
  overflow: hidden;
}

/* 项目列表项 */
.project-item {
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  color: var(--sidebar-text-muted);
  border-radius: var(--radius-sm);
  margin: 0.15rem 0.5rem;
  position: relative;
}

.project-item .project-delete-btn {
  display: none;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(239, 68, 68, 0.2);
  border: none;
  color: #f87171;
  font-size: 0.65rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  cursor: pointer;
}

.project-item:hover .project-delete-btn {
  display: block;
}

.project-item .project-delete-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fff;
}

.project-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text);
}

.project-item.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid #6b7280;
  padding-left: calc(2rem - 3px);
}

.project-name {
  flex: 0 0 auto;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-short-date {
  display: block;
  width: 100%;
  color: var(--sidebar-text-muted);
  font-size: 0.65rem;
  opacity: 0.7;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-short-date:hover {
  opacity: 1;
  color: #6ee7b7;
  text-decoration: underline;
}

/* 添加按钮 */
.add-project-btn,
.add-folder-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(156, 163, 175, 0.5);
  background: rgba(156, 163, 175, 0.1);
  color: #d1d5db;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-project-btn:hover,
.add-folder-btn:hover {
  background: rgba(156, 163, 175, 0.2);
  border-color: #9ca3af;
}

/* 提示词模板区域 */
.prompt-template-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sidebar-border);
}

.prompt-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.prompt-title .copy-hint {
  font-weight: normal;
  color: var(--sidebar-text-muted);
  font-size: 0.6rem;
  opacity: 0.7;
}

.prompt-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  padding: 0.25rem 0;
  font-size: 0.75rem;
  max-height: 180px;
  overflow-y: auto;
}

.prompt-item {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  color: var(--sidebar-text-muted);
}

.prompt-item:hover {
  background: var(--sidebar-bg-hover);
  border-left-color: var(--accent-primary);
  color: var(--sidebar-text);
}

.prompt-item.copied {
  background: rgba(16, 185, 129, 0.2);
  border-left-color: var(--accent-green);
  color: var(--accent-green);
}

/* 人员状态区域 */
.staff-schedule-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sidebar-border);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.staff-schedule-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.staff-manage-btn {
  font-size: 0.6rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(156, 163, 175, 0.5);
  background: rgba(156, 163, 175, 0.15);
  color: #d1d5db;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}

.staff-manage-btn:hover {
  background: rgba(156, 163, 175, 0.25);
  border-color: #9ca3af;
  text-decoration: none;
}

.staff-schedule-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  padding: 0.25rem 0;
  font-size: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.staff-schedule-empty {
  color: var(--sidebar-text-muted);
  font-size: 14px;
  padding: 1rem;
  text-align: center;
}

.staff-section-title {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  margin: 3px 5px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text-muted);
}

.staff-section-title.busy {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid rgba(239, 68, 68, 0.5);
}

.staff-section-title.free {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid rgba(16, 185, 129, 0.5);
}

/* 休息 / 调休标题颜色区分 */
.staff-section-title.rest {
  background: rgba(234, 179, 8, 0.08);
  border-left: 3px solid rgba(234, 179, 8, 0.5);
}

.staff-section-title.off {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid rgba(59, 130, 246, 0.5);
}

.staff-item {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--sidebar-border);
  transition: background 0.15s ease;
  margin: 0 0.3rem;
}

.staff-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.staff-item:hover {
  background: var(--sidebar-bg-hover);
}

.staff-item.busy {
  border-left: 3px solid rgba(239, 68, 68, 0.3);
  padding-left: 0.7rem;
}

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

.staff-name {
  font-weight: 600;
  color: var(--sidebar-text);
  font-size: 15px;
}

.staff-role {
  font-size: 12px;
  background: rgba(107, 114, 128, 0.3);
  color: #d1d5db;
  padding: 2px 6px;
  border-radius: 16px;
}

.staff-status-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.staff-status-tag.rest {
  background: rgba(234, 179, 8, 0.3);
  color: #fcd34d;
}

.staff-status-tag.off {
  background: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

.staff-busy-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 项目分组项（用于人员状态面板） */
.project-group-item {
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
}

.project-group-item:last-child {
  margin-bottom: 0;
}

.project-group-item .project-group-header {
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.15);
  border-left: 3px solid rgba(239, 68, 68, 0.5);
  font-weight: 600;
  font-size: 13px;
  color: var(--sidebar-text);
  transition: background 0.15s ease;
}

.project-group-item .project-group-header:hover {
  background: rgba(239, 68, 68, 0.2);
}

.project-group-item .project-group-name {
  color: #e5e7eb;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.project-group-item .project-group-name:hover {
  color: #fff;
  text-decoration: underline;
}

.project-group-item .project-staff-list {
  padding: 4px 0;
}

.staff-busy-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 6px;
}

.staff-busy-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text-muted);
  margin-bottom: 5px;
}

.staff-busy-item:last-child {
  margin-bottom: 0;
}

.staff-busy-item.conflict {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: var(--accent-red);
}

.staff-busy-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.staff-busy-project {
  color: #e5e7eb;
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.staff-busy-date {
  color: #9ca3af;
  font-size: 11px;
  flex-shrink: 0;
  opacity: 0.9;
  font-weight: 500;
  background: rgba(156, 163, 175, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.staff-busy-event-row {
  display: flex;
  align-items: flex-start;
  padding-left: 3px;
}

.staff-busy-event {
  color: var(--sidebar-text-muted);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.staff-free-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
}

.staff-free-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.15s ease;
  cursor: default;
}

.staff-free-item:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.staff-free-name {
  color: #6ee7b7;
  font-weight: 500;
  font-size: 14px;
}

.staff-free-role {
  color: var(--sidebar-text-muted);
  font-size: 12px;
}

/* 在岗 · 忙碌员工块：偏红色，强调占用 */
.staff-free-item.busy {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
}

.staff-free-item.busy .staff-free-name {
  color: #fecaca;
}

/* 休息员工块：偏黄色 */
.staff-free-item.rest {
  background: rgba(234, 179, 8, 0.06);
  border-color: rgba(234, 179, 8, 0.3);
}

.staff-free-item.rest .staff-free-name {
  color: #facc15;
}

/* 调休员工块：偏蓝紫 */
.staff-free-item.off {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.3);
}

.staff-free-item.off .staff-free-name {
  color: #bfdbfe;
}

/* ========== 主内容区 ========== */
.main-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  max-height: 100vh;
  overflow-y: auto;
  background: var(--bg-body);
}

.page {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 2rem 2rem;
}

/* 头部 */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

/* 返回按钮样式 */
.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  width: auto;
  min-width: 80px;
}

.back-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.back-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.back-icon {
  font-size: 1.125rem;
  line-height: 1;
  font-weight: 700;
}

.back-text {
  font-size: 0.875rem;
}

.logo-wrap {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.logo-img {
  width: 4rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  object-fit: contain;
  display: none;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px dashed transparent;
  outline: none;
  min-width: 4rem;
}

.logo-text[contenteditable="true"]:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.main-title {
  flex: 1;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #374151, #4b5563);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  outline: none;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-md);
  min-width: 0;
  width: auto;
  flex-shrink: 1;
}

.header-right {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  text-align: left;
  line-height: 1.5;
}

/* 项目信息区 */
.info-legend-row {
  display: grid;
  grid-template-columns: 3fr 1.2fr;
  column-gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.basic-info {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  /* 项目信息区域使用 px 控制字体大小，避免 rem 受全局缩放影响 */
  font-size: 14px;
  background: var(--bg-card);
}

.basic-info-title {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.basic-info-title::before {
  content: "📋";
}

.basic-info-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  row-gap: 0.4rem;
  column-gap: 0.4rem;
  margin-top: 0.4rem;
}

.info-label {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.info-value {
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  min-height: 1.6rem;
  outline: none;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.info-value:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

/* 备注区域 */
.legend {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  font-size: 14px;
  background: var(--bg-card);
}

.legend-title {
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  font-size: 0.75rem;
}

.notes-area {
  display: flex;
  flex-direction: column;
}

.notes-textarea {
  flex: 1;
  min-height: 120px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-size: 0.75rem;
  resize: vertical;
  outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
}

.notes-textarea:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.1);
}

/* 横向图例标签栏 */
.legend-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.legend-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.legend-tag {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  opacity: 0.8;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
}

.legend-tag .tag-color {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 3px;
  background: #9ca3af;
  opacity: 0.4;
  transition: opacity 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.legend-tag.business {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}

.legend-tag.script {
  background: linear-gradient(135deg, #fb923c, #f97316);
}

.legend-tag.shooting {
  background: linear-gradient(135deg, #fde047, #facc15);
}

.legend-tag.post {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.legend-tag.final {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.legend-tag.meeting {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.legend-tag.milestone {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.legend-tag.all {
  background: linear-gradient(135deg, #6b7280, #374151);
}

.legend-tag:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(15, 23, 42, 0.2);
}

.legend-tag.active {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.8);
  opacity: 1;
  transform: translateY(-1.5px) scale(1.03);
  font-weight: 600;
}

.legend-tag.active .tag-color {
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

/* 控制栏 */
.controls {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.6rem;
  background: linear-gradient(135deg, #fafbfc, #f5f7fa);
  color: var(--text-secondary);
}

.controls label {
  margin-right: 0.6rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.controls input[type="date"] {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  margin-right: 0.75rem;
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  width: 140px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.controls input[type="date"]:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
  outline: none;
}

.controls button {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
  cursor: pointer;
  margin-right: 0.5rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  width: auto;
  flex-shrink: 0;
  display: inline-block;
}

.controls button:hover {
  background: linear-gradient(135deg, #374151, #1f2937);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.controls .generate-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 2px solid #fca5a5;
  width: auto;
  flex-shrink: 0;
  min-width: 90px;
}

.controls .generate-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.controls .hint {
  color: var(--text-muted);
  margin-left: auto;
  font-size: 0.65rem;
}

/* Element UI 日期选择器在控制栏中的样式 */
.controls .el-date-editor {
  margin-right: 0.75rem;
}

.controls .el-date-editor .el-input__inner {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  height: auto;
  line-height: 1.5;
}

.event-type-select {
  margin-left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.event-type-select select {
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.export-img-btn,
.export-pdf-btn {
  margin-left: 0.5rem;
  white-space: nowrap;
  background: linear-gradient(135deg, #64748b, #475569) !important;
  width: auto;
  flex-shrink: 0;
  min-width: 100px;
}

.export-img-btn:hover,
.export-pdf-btn:hover {
  background: linear-gradient(135deg, #475569, #334155) !important;
}

/* ========== 日历 ========== */
.calendar-wrapper {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.8rem;
  user-select: none;
  min-height: 480px;
  overflow-y: auto;
  position: relative;
  background: var(--bg-card);
}

.calendar-wrapper.locked {
  pointer-events: none;
  opacity: 0.85;
}

.calendar-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: linear-gradient(135deg, #374151, #4b5563);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 1;
}

.calendar-header-cell {
  text-align: center;
  padding: 0.75rem 0.25rem;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.calendar-header-cell:last-child {
  border-right: none;
}

.calendar-week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border-light);
  min-height: 6rem;
  position: relative;
}

.calendar-week-row:last-child {
  border-bottom: none;
}

.calendar-day-cell {
  border-right: 1px solid var(--border-light);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
  transition: all 0.15s ease;
  /* 固定每个日期格子高度，避免事件过多时整行高度被拉得过高导致排版错乱 */
  height: 120px;
  overflow: hidden;
}

.calendar-week-row:nth-child(odd) .calendar-day-cell {
  background: #fafbfc;
}

.calendar-day-cell:last-child {
  border-right: none;
}

.calendar-day-cell:hover {
  background: #f0f4ff;
}

.calendar-day-cell.selecting {
  outline: 2px solid #6b7280;
  outline-offset: -2px;
  background: #f3f4f6;
}

.date-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.date-outside {
  color: var(--text-muted);
  opacity: 0.4;
}

.events-container {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 0.1rem;
  min-height: 1rem;
  position: relative;
  /* 事件列表内部滚动，保持日历网格稳定 */
  overflow-y: auto;
}

/* 事件 */
.event-item {
  font-size: 0.75rem;
  padding: 0.3rem 1.2rem 0.3rem 0.5rem;
  margin-bottom: 0.2rem;
  border-radius: 0;
  cursor: move;
  border: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  z-index: 2;
  font-weight: 500;
  transition: all 0.15s ease;
}

.event-item.event-start {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.event-item.event-end {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.event-item.event-middle {
  border-radius: 0;
  margin-left: -1px;
  margin-right: -1px;
}

.event-business {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #fff;
}

.event-script {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #fff;
}

.event-shooting {
  background: linear-gradient(135deg, #fde047, #facc15);
  color: #000;
}

.event-post {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #fff;
}

.event-final {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #fff;
}

.event-meeting {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
}

.event-milestone {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  color: #fff !important;
  font-weight: 600;
}

.event-milestone::before {
  content: "🎯 ";
}

.event-item:hover {
  transform: translateY(-1px);
  z-index: 3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  filter: brightness(1.05);
}

.event-item.selected {
  border: 2px solid #4b5563;
}

.event-delete-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: #fff;
  font-size: 0.6rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.event-item:hover .event-delete-btn {
  display: flex;
}

.event-delete-btn:hover {
  background: #ef4444;
}

.status-icon {
  font-size: 0.65rem;
  margin-right: 0.15rem;
  font-weight: bold;
  cursor: pointer;
}

.status-todo {
  opacity: 0.8;
}

.status-doing {
  color: #3b82f6;
}

.status-done {
  color: #10b981;
}

.status-blocked {
  color: #ef4444;
}

.event-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 0.2rem;
}

.event-owner {
  opacity: 0.9;
  font-size: 0.6rem;
  margin-left: 0.2rem;
  font-weight: normal;
}

/* 日历格子整体状态标记（根据当天所有事件的状态聚合） */
.calendar-day-cell.has-events {
  position: relative;
}

.calendar-day-cell.has-events::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: var(--radius-sm);
  opacity: 0.14;
  pointer-events: none;
}

.calendar-day-cell.day-status-todo.has-events::before {
  background: #9ca3af;
}

.calendar-day-cell.day-status-doing.has-events::before {
  background: #3b82f6;
}

.calendar-day-cell.day-status-done.has-events::before {
  background: #10b981;
}

.calendar-day-cell.day-status-blocked.has-events::before {
  background: #ef4444;
}

.no-data-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2rem 0;
}

/* ========== 右侧详情面板 ========== */
.detail-panel {
  background: var(--bg-card);
  border-radius: 0;
  box-shadow: none;
  padding: 1.5rem 1.25rem;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--border-light);
}

.detail-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  margin-left: 0.5rem;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: #374151;
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  padding: 0.4rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-input);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  padding: 0.25rem;
  outline: none;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box select {
  font-size: 0.65rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-width: 5rem;
  flex-shrink: 0;
  background: #fff;
  color: var(--text-primary);
}

/* 进度条 */
.progress-bar-wrap {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fafbfc, #f5f7fa);
}

.progress-bar-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.progress-bar-label span:last-child {
  font-weight: 700;
  color: #374151;
}

.progress-bar {
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4b5563, #6b7280);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

/* 详情字段 */
.detail-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.4rem;
  gap: 0.25rem;
}

.detail-field label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.detail-field input,
.detail-field select,
.detail-field textarea {
  font-size: 0.85rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.detail-field input:focus,
.detail-field select:focus,
.detail-field textarea:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
  outline: none;
}

.detail-field textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.detail-empty {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.6;
  padding: 1rem;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  text-align: center;
}

/* 变更日志 */
#change-log {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.6rem;
}

#change-log ul {
  list-style: none;
  padding-left: 0;
}

#change-log li {
  margin-bottom: 0.3rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-size: 0.65rem;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border-left: 2px solid var(--border-light);
  padding-left: 0.5rem;
}

#change-log time {
  color: var(--text-muted);
  margin-right: 0.4rem;
}

#change-log .log-project {
  color: #4b5563;
  font-weight: 600;
}

/* ========== 视图切换标签 ========== */
.view-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.view-tab {
  flex: 1;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.view-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.view-tab.active {
  background: linear-gradient(135deg, #374151, #4b5563);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.view-tab .tab-icon {
  font-size: 1rem;
}

.view-tab .tab-count {
  font-size: 14px;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  margin-left: 0.25rem;
}

.view-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ========== 项目总览表格 ========== */
.overview-panel {
  display: none;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.overview-panel.active {
  display: block;
}

.overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.overview-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.overview-actions {
  display: flex;
  gap: 0.5rem;
}

.overview-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.overview-btn:hover {
  background: var(--bg-hover);
  border-color: #9ca3af;
}

.overview-btn.primary {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
  border: none;
  font-weight: 600;
}

.overview-btn.primary:hover {
  background: linear-gradient(135deg, #374151, #1f2937);
}

/* 突出显示图标符号 */
.overview-btn.primary {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 项目分组 */
.project-group {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.project-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  cursor: pointer;
  user-select: none;
}

.project-group-header:hover {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.project-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.project-group-title .group-icon {
  font-size: 1.1rem;
}

.project-group-badge {
  font-size: 14px;
  padding: 0.2rem 0.6rem;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
  border-radius: 1rem;
  font-weight: 600;
}

.project-group.in-progress .project-group-badge {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.project-group.cooperation .project-group-badge {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
}

.project-group.outsource .project-group-badge {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
}

.project-group-toggle {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.project-group.collapsed .project-group-toggle {
  transform: rotate(-90deg);
}

.project-group-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.project-group.collapsed .project-group-content {
  max-height: 0;
}

/* 项目表格 */
.project-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.project-table th {
  padding: 0.65rem 0.8rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fafbfc;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.project-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.project-table tr:hover td {
  background: #f8fafc;
}

.project-table tr.clickable {
  cursor: default;
}

.project-table tr.clickable:hover td {
  background: #f8fafc;
}

/* 表格容器横向滚动 */
.table-scroll-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.table-scroll-wrapper .project-table {
  min-width: 1600px;
}

/* 拖拽排序样式 */
.sortable-ghost {
  opacity: 0.4;
  background: #f0f0f0;
}

.sortable-chosen {
  cursor: grabbing;
}

.sortable-drag {
  opacity: 0.8;
}

.project-table tbody tr {
  cursor: move;
  transition: background-color 0.2s ease;
}

.project-table tbody tr.sortable-ghost {
  background: #e5e7eb;
}

.project-table tbody tr.sortable-chosen {
  background: #dbeafe;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 交互元素保持原有光标样式 */
.project-table tbody tr button,
.project-table tbody tr input,
.project-table tbody tr select,
.project-table tbody tr textarea,
.project-table tbody tr .action-btn,
.project-table tbody tr .inline-input,
.project-table tbody tr .inline-select {
  cursor: default;
  pointer-events: auto;
}

/* 表格单元格样式 */
.cell-index {
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 40px;
  text-align: center;
}

.cell-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-name:hover {
  color: var(--accent-primary);
}

/* 月份列样式 */
.cell-months {
  width: 180px;
  min-width: 180px;
  max-width: 220px;
}

.months-display {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
  display: inline-block;
  max-width: 100%;
}

/* Element UI Select 在表格中的样式优化 */
.project-table .el-select {
  width: 100%;
}

.project-table .el-select .el-input__inner {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  height: auto;
  line-height: 1.5;
}

.project-table .el-select .el-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  margin: 0.1rem;
  height: auto;
  line-height: 1.3;
}

.project-table .el-select .el-tag__close {
  font-size: 0.7rem;
}

/* 状态标签 */
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.status-tag.doing {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.status-tag.done {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
}

.status-tag.pending {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
}

.status-tag.paused {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
}

.status-tag.uploaded {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

.status-tag.released {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  color: #be185d;
}

/* 分级标签 */
.tier-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}

.tier-tag.t0 {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.tier-tag.t1 {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
}

.tier-tag.t2 {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #fff;
}

.tier-tag.t3 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
}

/* 分类标签 */
.category-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 600;
}

.category-tag.travel {
  background: #dbeafe;
  color: #1d4ed8;
}

.category-tag.modify {
  background: #fce7f3;
  color: #be185d;
}

.category-tag.fun {
  background: #dcfce7;
  color: #15803d;
}

.category-tag.review {
  background: #fef3c7;
  color: #a16207;
}

.category-tag.story {
  background: #f3e8ff;
  color: #7c3aed;
}

.category-tag.science {
  background: #e0e7ff;
  color: #4338ca;
}

.category-tag.outsource {
  background: #f1f5f9;
  color: #475569;
}

/* 图标状态 */
.icon-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.icon-status.business {
  background: #fef3c7;
}

.icon-status.secret {
  background: #fee2e2;
}

.icon-status.normal {
  background: #f1f5f9;
  color: var(--text-muted);
}

/* 负责人头像 */
.owner-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.owner-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
}

.owner-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 日期单元格 */
.date-cell {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.date-cell.overdue {
  color: var(--accent-red);
  font-weight: 600;
}

.date-cell.today {
  color: var(--accent-green);
  font-weight: 600;
}

.date-cell.empty {
  color: var(--text-muted);
  font-style: italic;
}

/* 操作按钮 */
.action-btns {
  display: flex;
  gap: 0.25rem;
}

.action-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.action-btn.delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* 添加行按钮 */
.add-row-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  width: 100%;
  border: 1px dashed var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.add-row-btn:hover {
  background: var(--bg-hover);
  border-color: #9ca3af;
  color: var(--text-secondary);
}

/* 编辑模式 */
.inline-select {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
}

.inline-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* 状态下拉框颜色标签 */
.status-select {
  font-weight: 600;
}

.status-select[data-status="doing"] {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-color: #fcd34d;
}

.status-select[data-status="done"] {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
  border-color: #6ee7b7;
}

.status-select[data-status="pending"] {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
  border-color: #a5b4fc;
}

.status-select[data-status="paused"] {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  border-color: #fca5a5;
}

.status-select[data-status="uploaded"] {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border-color: #93c5fd;
}

.status-select[data-status="released"] {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  color: #be185d;
  border-color: #f9a8d4;
}

.inline-input {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  width: 100%;
  min-width: 80px;
}

.inline-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.inline-input:hover {
  background: var(--bg-hover) !important;
}

.name-input:hover,
.name-input:focus {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm);
}

.index-input:hover,
.index-input:focus {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm);
}

/* 快速筛选栏 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #fafbfc, #f5f7fa);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-select {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
}

.filter-input {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  width: 150px;
}

.filter-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.filter-btn.active {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
  border-color: transparent;
}

/* 统计卡片 */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-card .stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-card.highlight {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #fcd34d;
}

.stat-card.highlight .stat-label {
  color: #92400e;
}

/* 详情视图面板 */
.detail-view-panel {
  display: none;
}

.detail-view-panel.active {
  display: block;
}

/* 员工日历面板 */
.staff-calendar-panel {
  display: none;
}

.staff-calendar-panel.active {
  display: block;
}

/* 员工项目列表 */
.staff-projects-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ========== 底部按钮组 ========== */
.bottom-btn-group {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  gap: 0.5rem;
}

.share-btn {
  border-radius: 2rem;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-weight: 500;
}

.share-btn:hover {
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
  border-color: #6366f1;
  transform: translateY(-2px);
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.lock-btn {
  border-radius: 2rem;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-weight: 500;
}

.lock-btn:hover {
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
  border-color: #6b7280;
  transform: translateY(-2px);
}

body.locked .lock-btn {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
  border-color: transparent;
}

body.readonly-mode .share-btn {
  display: none;
}

/* ========== Toast提示 ========== */
.toast-container {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
  font-weight: 500;
  text-align: center;
}

.toast.success {
  border-left: 4px solid var(--accent-green);
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #047857;
}

.toast.error {
  border-left: 4px solid var(--accent-red);
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #dc2626;
}

.toast.warning {
  border-left: 4px solid var(--accent-orange);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #d97706;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #fafbfc, #f5f7fa);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}


/* 员工表单 */
.staff-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.staff-form input,
.staff-form select {
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.staff-form input:focus,
.staff-form select:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
  outline: none;
}

.staff-form input {
  flex: 1;
}

.staff-form button {
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.staff-form button:hover {
  background: linear-gradient(135deg, #374151, #1f2937);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.staff-list-manage {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-input);
}

.staff-list-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  gap: 0.75rem;
  transition: background 0.15s ease;
}

.staff-list-item:last-child {
  border-bottom: none;
}

.staff-list-item:hover {
  background: var(--bg-hover);
}

.staff-list-item .name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}

.staff-list-item .role {
  font-size: 14px;
  color: #4b5563;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.staff-list-item .delete-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--accent-red);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.staff-list-item .delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* 人员标签 */
.people-row-wrapper {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

/* 人员分配头部：标题 + 新增按钮并排显示 */
.people-row-wrapper .info-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.people-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.people-tag {
  /* 一行显示 3 个标签，支持自动换行 */
  flex: 0 0 calc(33.333% - 0.24rem);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border-light);
  min-width: 0;
}

.people-tag select {
  font-size: 14px;
  padding: 0.2rem 0.3rem;
  flex: 0 0 auto;
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.people-tag .info-value {
  border: none;
  border-left: 1px solid var(--border-light);
  min-width: 2rem;
  width: 100%;
  background: transparent;
}

.people-name-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
}

.people-add-btn {
  padding: 0.15rem 0.55rem;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.people-add-btn:hover {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.08);
  color: #3b82f6;
}

.project-name-period-row {
  grid-column: span 6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-name-period-row .info-label {
  flex: 0 0 auto;
}

.project-name-period-row .info-value {
  flex: 1;
}

.project-name-field {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.sidebar ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ========== 响应式 ========== */
@media (max-width: 1400px) {
  .layout {
    grid-template-columns: 200px 1fr;
  }
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 180px 1fr;
  }

  .main-area {
    padding: 1rem;
  }
}

@media (max-width: 992px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .detail-panel {
    display: none;
  }
}

/* ========== 在线用户指示器 ========== */
.online-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.online-count {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ========== 登录页面 ========== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 400px;
  max-width: 90vw;
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-btn {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ========== 新建项目弹窗表单布局 ========== */
.project-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-dialog-form .el-form-item {
  margin-bottom: 4px;
}

.project-dialog-row {
  display: flex;
  gap: 8px;
}

.project-dialog-item {
  flex: 1;
  margin: 0;
}

.project-dialog-inline-group {
  display: flex;
  gap: 8px;
}

.project-dialog-attr-owner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-dialog-attr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-dialog-owner-label {
  color: #606266;
  font-size: 13px;
}

.project-dialog-owner-select {
  min-width: 220px;
  flex: 1;
}

.project-dialog-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.project-dialog-date-label {
  font-size: 12px;
  color: #606266;
  margin-bottom: 2px;
}

/* ========== 事件命名弹窗样式 ========== */
.event-name-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-name-dialog-form .el-form-item {
  margin-bottom: 0;
}

.template-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.template-option {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.template-option:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.05);
}

.template-option.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  font-weight: 500;
}