/* ============================================
   团队日程工作台（TeamFlow）- 样式系统
   严格按照产品技术文档设计规范
   ============================================ */

/* ---- 设计变量 ---- */
:root {
  /* 项目标识色 */
  --color-project-a: #E8929F;      /* 玫瑰粉 */
  --color-project-a-deep: #D97B8B;     /* 玫瑰粉加深（hover / toast） */
  --color-incubate: #7EC4A8;           /* 薄荷绿 */
  --color-book: #E5C088;               /* 琥珀金 */
  --color-schedule-accent: #88B4D4;       /* 天空蓝 */
  --color-echo-schedule: #A998C9;      /* 薰衣草紫 */

  /* 功能色 */
  --color-conflict: #E57373;           /* 珊瑚红 - 冲突 */
  --color-cascade: #FFB74D;            /* 琥珀橙 - 级联 */
  --color-success: #66BB6A;            /* 绿色 - 完成 */
  --color-info: #42A5F5;               /* 蓝色 - 进行中 */

  /* 中性色 */
  --bg-page: #FAFAF8;                  /* 香草奶油 - 页面背景 */
  --bg-card: #FFFFFF;                  /* 卡片背景 */
  --bg-sidebar: #F5F3F0;              /* 侧边栏背景 */
  --bg-hover: #F0EEEB;                /* 悬停背景 */
  --bg-tag: #F5F3F0;                  /* 标签背景 */
  --border-color: #E8E5E0;            /* 边框 */
  --border-light: #F0EEEB;            /* 浅边框 */

  /* 文字色 */
  --text-primary: #1C1C1E;            /* 深灰黑 - 主文字 */
  --text-secondary: #6B6B70;           /* 次要文字 */
  --text-tertiary: #9B9BA0;            /* 辅助文字 */
  --text-inverse: #FFFFFF;             /* 反白文字 */

  /* 圆角系统 */
  --radius-sm: 5px;                    /* 按钮内元素 */
  --radius-md: 8px;                    /* 卡片、输入框 */
  --radius-lg: 12px;                   /* 模态框、浮层 */
  --radius-full: 9999px;              /* 胶囊 */

  /* 阴影系统 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.07);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.10);

  /* 布局 */
  --sidebar-width: 220px;
  --sidebar-collapsed: 56px;
  --topbar-height: 56px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* ---- App 布局 ---- */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   侧边栏
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-light);
}

.logo-icon { font-size: 28px; line-height: 1; }
.logo { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.logo-subtitle { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.sidebar-nav { padding: 12px 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--color-project-a); color: var(--text-inverse); }
.nav-item.active .nav-badge { background: rgba(255,255,255,0.3); color: var(--text-inverse); }

.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--color-conflict);
  color: var(--text-inverse);
  min-width: 18px;
  text-align: center;
}

.sidebar-section {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border-light);
}

.sidebar-section-title {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
  padding: 6px 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--color-primary);
}

/* 侧边栏区块标题旁的小编辑按钮（如「工作任务 ✏️」） */
.btn-mini-edit {
  margin-left: auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
.btn-mini-edit:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-section:nth-of-type(2) .sidebar-section-title::before { background: #88B4D4; }

.project-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.project-filter-item:hover { background: var(--bg-hover); }
.project-filter-item.active { background: var(--bg-hover); color: var(--text-primary); font-weight: 600; }

/* 侧边栏日程窗口目录（v3.7.0 新增）：name/count 布局 + 选中玫瑰粉 */
.project-filter-item .sf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-filter-item .sf-count { margin-left: auto; }

/* 「新建日程窗口」弹窗里的窗口列表 */
.win-list { display: flex; flex-direction: column; gap: 6px; }
.win-list-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--bg-secondary, #f7f7f7); font-size: 13px;
}
.win-list-row .win-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.win-list-row .win-name { font-weight: 500; }
.win-list-row .win-user { font-size: 11px; color: var(--text-tertiary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-list-row .btn-sm { padding: 3px 8px; font-size: 11px; }

.project-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border-light);
}

.user-switcher-label {
  font-size: 11px;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.user-select-wrapper {
  position: relative;
}

.user-select-wrapper::after {
  content: '▼';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--text-tertiary);
  pointer-events: none;
}

#currentUserSelect {
  width: 100%;
  padding: 8px 28px 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
}

#currentUserSelect:focus { outline: 2px solid var(--color-schedule-accent); }

/* ============================================
   主内容区
   ============================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- 顶部栏 ---- */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 16px;
}

.tab-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab:hover { background: var(--bg-hover); }
.tab.active { background: var(--color-project-a); color: var(--text-inverse); }

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

/* 顶部菜单 tab 内的删除按钮（v3.7.0:日程窗口可删除） */
.tab { position: relative; padding-right: 26px; }
.tab .tab-remove {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.55);
  font-size: 14px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}
.tab:hover .tab-remove { display: flex; }
.tab .tab-remove:hover { background: rgba(0,0,0,0.18); color: #fff; }
/* 在 active 状态下用反色更明显 */
.tab.active .tab-remove { background: rgba(255,255,255,0.25); color: #fff; }
.tab.active .tab-remove:hover { background: rgba(255,255,255,0.42); color: #fff; }

/* 顶部菜单右侧：「+ 新建日程窗口」按钮 */
.tab-add-window {
  padding: 7px 14px;
  margin-left: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #FFF1F3;
  color: var(--color-project-a);
  border: 1px dashed var(--color-project-a);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}
.tab-add-window:hover { background: #FFE4E9; border-style: solid; }

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

/* 云端同步状态指示器 */
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-secondary, #999);
  white-space: nowrap;
  user-select: none;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bbb;
  flex-shrink: 0;
}
.sync-online .sync-dot { background: #34c759; box-shadow: 0 0 4px rgba(52,199,89,.6); }
.sync-online { color: #2e9e4f; background: rgba(52,199,89,.12); }
.sync-connecting .sync-dot { background: #ff9500; animation: syncPulse 1s infinite; }
.sync-connecting { color: #c77700; background: rgba(255,149,0,.12); }
.sync-offline .sync-dot { background: #b0b0b0; }
.sync-offline { color: #999; background: rgba(0,0,0,.05); }
@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ---- 按钮 ---- */
.btn {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-primary { background: var(--color-project-a); color: var(--text-inverse); }
.btn-primary:hover { background: var(--color-project-a-deep); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger { background: var(--color-conflict); color: var(--text-inverse); }
.btn-danger:hover { opacity: 0.85; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: var(--radius-sm); }

/* ---- 视图容器 ---- */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ============================================
   项目视图 - 剧集卡片 + 任务表格
   ============================================ */
.episode-list { display: flex; flex-direction: column; gap: 16px; }

.episode-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.episode-card:hover { box-shadow: var(--shadow-md); }

.episode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.episode-title-area { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.episode-color-bar {
  width: 4px;
  height: 24px;
  border-radius: 2px;
  flex-shrink: 0;
}

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

.episode-name.editable {
  cursor: text;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  min-width: 120px;
  max-width: 360px;
  display: inline-block;
  word-break: break-word;
}
.episode-name.editable:hover {
  background: rgba(125, 125, 200, 0.06);
  border-color: rgba(125, 125, 200, 0.25);
}
.episode-name.editable:hover::after {
  content: ' ✏️';
  font-size: 12px;
  opacity: 0.6;
}
.inline-name-input {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  border: 1px solid var(--color-primary, #7B68EE);
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  margin: -5px -9px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.15);
}

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

.status-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-done { background: rgba(102,187,106,0.12); color: #2E7D32; }
.status-progress { background: rgba(66,165,245,0.12); color: #1565C0; }
.status-todo { background: rgba(155,155,160,0.12); color: #616161; }
.status-planning { background: rgba(255,183,77,0.15); color: #E65100; }

.progress-wrapper { display: flex; align-items: center; gap: 8px; min-width: 120px; }

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-tag);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-text { font-size: 12px; color: var(--text-tertiary); font-weight: 600; min-width: 32px; text-align: right; }

.episode-actions { display: flex; gap: 4px; align-items: center; }

/* 剧集完成按钮（绿色调强调） */
.btn-complete {
  background: var(--color-success-bg, #E8F5E9) !important;
  color: var(--color-success, #2E7D32) !important;
  font-size: 14px !important;
}
.btn-complete:hover {
  background: var(--color-success, #2E7D32) !important;
  color: #fff !important;
  transform: scale(1.05);
}

/* 删除剧集按钮（红色调强调危险性） */
.btn-delete-episode {
  background: #FFF0F0 !important;
  color: #D32F2F !important;
}
.btn-delete-episode:hover {
  background: #D32F2F !important;
  color: #fff !important;
}

/* 撤销完成按钮 */
.btn-restore {
  font-size: 12px !important;
  color: var(--text-tertiary) !important;
  padding: 4px 10px !important;
}

/* 已完成剧集徽章 */
.badge-completed {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #66BB6A, #43A047);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.25);
}

/* 已完成剧集卡片样式 */
.episode-card.is-completed {
  opacity: 0.75;
  background: linear-gradient(to right, #F9FBF7 0%, var(--bg-card) 30%);
  border-left: 4px solid var(--color-success, #4CAF50);
}
.episode-card.is-completed:hover { opacity: 1; }

/* 剧集分组 */
.episode-section { margin-bottom: 24px; }

.episode-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-tag);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border-left: 3px solid var(--color-primary);
}
.episode-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.episode-section-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 10px;
}

.episode-section-completed .episode-section-header {
  border-left-color: var(--color-success, #4CAF50);
  background: linear-gradient(to right, #E8F5E9, #F1F8E9);
}
.episode-section-toggle {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.episode-section-toggle:hover {
  background: linear-gradient(to right, #C8E6C9, #DCEDC8) !important;
}
.episode-section-completed.collapsed .episode-list {
  display: none;
}

/* ---- 任务表格 ---- */
.task-table-wrapper { overflow-x: auto; }

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

.task-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-tag);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.task-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.task-table tr:last-child td { border-bottom: none; }
.task-table tr:hover td { background: rgba(0,0,0,0.015); }

.task-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-tag);
  color: var(--text-secondary);
}

.task-step.done { background: var(--color-success); color: white; }
.task-step.progress { background: var(--color-info); color: white; }

.task-name-cell { font-weight: 500; color: var(--text-primary); }

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  background: var(--bg-tag);
  color: var(--text-secondary);
}
.assignee-chip.clickable {
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.assignee-chip.clickable:hover {
  background: var(--bg-hover);
  border-color: var(--color-project-a);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.assignee-chip.clickable:active { transform: translateY(0); }
.assignee-chip.empty { color: var(--text-tertiary); font-style: italic; }

/* 负责人多选展示：主 chip + 叠加小标 */
.assignee-chips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.assignee-chip-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-project-a);
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
}

.task-date { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.task-date.has-conflict { color: var(--color-conflict); font-weight: 600; }
.task-date.editable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.task-date.editable:hover {
  background: var(--bg-hover);
  border-color: var(--color-schedule-accent);
  color: var(--text-primary);
}
.task-duration-tag.editable {
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.task-duration-tag.editable:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
/* 内联日期编辑器 */
.inline-date-wrap {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 10;
  position: relative;
}
.inline-date-shortcuts {
  display: flex;
  gap: 4px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border-color);
}
.date-shortcut-btn {
  flex: 1;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--color-schedule-accent);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--color-schedule-accent);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.date-shortcut-btn:hover {
  background: var(--color-schedule-accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(150, 134, 215, 0.3);
}
.date-shortcut-btn:active {
  transform: translateY(0);
}
/* 区间切换按钮：与快捷按钮区分（虚线边框 + 琥珀色调） */
.date-shortcut-btn.range-toggle-btn {
  border-style: dashed;
  border-color: var(--color-book, #E5C088);
  color: var(--color-book, #B8860B);
  background: transparent;
}
.date-shortcut-btn.range-toggle-btn:hover {
  background: var(--color-book, #E5C088);
  border-style: solid;
  color: #fff;
  box-shadow: 0 2px 4px rgba(229, 192, 136, 0.4);
}
.inline-date-inputs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.inline-date-input {
  font-size: 12px;
  padding: 2px 4px;
  border: 1px solid var(--color-schedule-accent);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  width: 120px;
  outline: none;
}
.inline-date-input:focus {
  border-color: var(--color-project-a);
  box-shadow: 0 0 0 2px rgba(232, 146, 159, 0.2);
}

.task-duration { font-size: 12px; color: var(--text-tertiary); }

.task-status-cell { text-align: center; }

.task-action-btn {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
}
.task-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.task-row-conflict {
  background: rgba(229,115,115,0.04) !important;
}

.conflict-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--color-conflict);
  font-weight: 600;
}

/* ---- 默认负责人面板 ---- */
.default-assignee-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.default-assignee-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
/* 一行多工作项：grid 自适应列数，避免每个 step 占一行的浪费 */
.default-assignee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.default-assignee-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary, var(--bg-card));
  transition: border-color 0.15s, box-shadow 0.15s;
}
.default-assignee-card:hover {
  border-color: var(--border-default, var(--border-light));
  box-shadow: var(--shadow-sm);
}
.default-assignee-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.default-assignee-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.default-assignee-card .assignee-chip.clickable {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  font-size: 12px;
}
.default-assignee-card .assignee-chip.clickable:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ---- 筛选栏 ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover { border-color: var(--text-tertiary); }
.filter-chip.active { background: var(--color-project-a); color: var(--text-inverse); border-color: var(--color-project-a); }

/* ============================================
   日历视图 - 周视图
   ============================================ */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-nav { display: flex; align-items: center; gap: 8px; }

.calendar-nav button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
  font-size: 16px;
}
.calendar-nav button:hover { background: var(--bg-hover); color: var(--text-primary); }

.calendar-title { font-size: 16px; font-weight: 600; min-width: 200px; text-align: center; }

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

.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-width: 700px;
}

.cal-cell {
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 80px;
}
.cal-cell:last-child { border-right: none; }

/* 三时段单元 */
.cal-cell-slots { padding: 0; min-height: 0; }
.cal-slot {
  flex: 0 1 auto;
  border-bottom: 1px dashed var(--border-light);
  padding: 6px 4px 7px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-slot:last-child { border-bottom: none; }
.cal-slot-label {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  opacity: 0.85;
  padding-bottom: 3px;
  margin-bottom: 2px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.5px;
}
.cal-slot-morning { background: linear-gradient(180deg, rgba(255,230,180,0.18), rgba(255,230,180,0.04) 80%); }
.cal-slot-afternoon { background: linear-gradient(180deg, rgba(255,210,170,0.18), rgba(255,210,170,0.04) 80%); }
.cal-slot-evening { background: linear-gradient(180deg, rgba(180,200,255,0.18), rgba(180,200,255,0.04) 80%); }

/* 超过 3 个任务时折叠显示 */
.cal-task-overflow {
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--bg-tag);
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  transition: all 0.15s;
}
.cal-task-overflow:hover { background: var(--bg-hover); color: var(--text-primary); }

.cal-header {
  background: var(--bg-tag);
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-light);
}
.cal-header:last-child { border-right: none; }

.cal-header-day { font-size: 11px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; }
.cal-header-date { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-top: 2px; }
.cal-header.today .cal-header-date { color: var(--color-project-a); }
.cal-header.today { background: rgba(232,146,159,0.08); }

.cal-time-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: right;
  padding-right: 6px;
  padding-top: 2px;
  background: var(--bg-tag);
}

.cal-task {
  position: relative;
  margin: 0;
  padding: 5px 8px 6px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cal-task:hover { transform: translateX(1px); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }

.cal-task-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cal-task-meta, .cal-task-time {
  font-size: 10px;
  opacity: 0.85;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-task.all-day {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,255,255,0.4) 6px, rgba(255,255,255,0.4) 8px);
}

.cal-task.conflict {
  border: 1px solid var(--color-conflict);
  box-shadow: 0 0 0 1px var(--color-conflict);
}

.conflict-marker {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
  color: var(--color-conflict);
}

/* ---- 日历任务弹窗 ---- */
.cal-day-tasks {
  position: absolute;
  z-index: 10;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 8px;
  min-width: 200px;
  max-width: 280px;
}

/* ============================================
   甘特图视图
   ============================================ */
.gantt-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.gantt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.gantt-title { font-size: 15px; font-weight: 600; }

.gantt-body { overflow-x: auto; }

.gantt-grid {
  display: flex;
  flex-direction: column;
  min-width: 1000px;
}

.gantt-row-header {
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 2;
  border-right: 2px solid var(--border-color);
}

.gantt-task-label {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gantt-timeline-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.gantt-day-header {
  flex: none;
  text-align: center;
  padding: 6px 0;
  font-size: 10px;
  color: var(--text-tertiary);
  border-right: 1px solid var(--border-light);
}

.gantt-day-header.weekend { background: var(--bg-tag); }
.gantt-day-header.today { background: rgba(232,146,159,0.1); color: var(--color-project-a); font-weight: 700; }

.gantt-day-header .day-num { font-size: 13px; font-weight: 700; color: var(--text-primary); display: block; }
.gantt-day-header.today .day-num { color: var(--color-project-a); }

.gantt-row {
  display: flex;
  position: relative;
  height: 36px;
  border-bottom: 1px solid var(--border-light);
}

.gantt-row:hover { background: rgba(0,0,0,0.015); }

.gantt-bar {
  position: absolute;
  top: 6px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-sm);
}

.gantt-bar:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.gantt-bar.has-conflict { border: 2px solid var(--color-conflict); }

.gantt-bar-done { opacity: 0.6; }
.gantt-bar-progress { position: relative; }
.gantt-bar-progress::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 50%;
  background: rgba(255,255,255,0.35);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-project-a);
  z-index: 1;
  border-radius: 1px;
}

/* ============================================
   级联变更弹窗
   ============================================ */
.cascade-modal-content {
  max-width: 520px;
}

.cascade-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.cascade-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255,183,77,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.cascade-title { font-size: 16px; font-weight: 600; }
.cascade-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.cascade-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.cascade-item {
  padding: 12px 14px;
  background: var(--bg-tag);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-cascade);
}

.cascade-item-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.cascade-change-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
}

.cascade-old { text-decoration: line-through; color: var(--text-tertiary); }
.cascade-arrow { color: var(--color-cascade); font-weight: 700; }
.cascade-new { color: var(--text-primary); font-weight: 600; }

.cascade-cross-project {
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(229,115,115,0.08);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-conflict);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cascade-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   冲突面板
   ============================================ */
.conflict-panel {
  background: rgba(229,115,115,0.06);
  border: 1px solid rgba(229,115,115,0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.conflict-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-conflict);
  margin-bottom: 8px;
}

.conflict-list { display: flex; flex-direction: column; gap: 6px; }

.conflict-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  flex-wrap: wrap;
}

.conflict-list-item:hover { box-shadow: var(--shadow-sm); transform: translateX(2px); }

.conflict-ep-name {
  font-weight: 600;
  color: var(--text-primary);
  padding: 2px 6px;
  background: rgba(125,125,200,0.1);
  border-radius: 4px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conflict-task-name { color: var(--text-secondary); }
.conflict-assignee { font-size: 11px; }
.conflict-icon { color: var(--color-conflict); font-weight: 600; padding: 0 2px; }

/* ============================================
   模态框通用
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

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

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

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 18px;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 20px 22px; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
}

/* 自定义确认弹窗 */
.modal-confirm { max-width: 420px; }
.modal-confirm-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* 选择负责人弹窗 */
.modal-pick { width: 360px; max-width: 92vw; }
.pick-list { padding: 10px !important; max-height: 60vh; overflow-y: auto; }
.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.pick-item:hover { background: var(--bg-hover); }
.pick-item.current { background: var(--color-project-a); color: var(--text-inverse); }
.pick-item.current .pick-name, .pick-item.current .pick-role { color: var(--text-inverse); }
.pick-item.current .pick-role { opacity: 0.85; }
.pick-avatar {
  font-size: 22px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tag);
  border-radius: 50%;
  flex-shrink: 0;
}
.pick-item.current .pick-avatar { background: rgba(255,255,255,0.22); }
.pick-info { flex: 1; min-width: 0; }
.pick-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.pick-role { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.pick-check { font-size: 18px; font-weight: 700; }

/* 任务工期（时段）标签 */
.task-duration-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-tag);
  border: 1px solid var(--border-light);
}
.task-duration-tag.morning { background: #FFF3E0; color: #E65100; border-color: #FFCC80; }
.task-duration-tag.afternoon { background: #FFF8E1; color: #F57F17; border-color: #FFE082; }
.task-duration-tag.evening { background: #E8EAF6; color: #3949AB; border-color: #9FA8DA; }
.task-duration-tag.all-day { background: #E0F2F1; color: #00695C; border-color: #80CBC4; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-schedule-accent);
  box-shadow: 0 0 0 3px rgba(136,180,212,0.15);
}

.form-textarea { resize: vertical; min-height: 70px; }

.form-row { display: flex; gap: 12px; }

/* 时段 chip 单选组（避免 select 重复图标） */
.duration-chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.duration-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.duration-chip:hover {
  border-color: var(--color-schedule-accent);
  color: var(--text-primary);
}
.duration-chip.active {
  background: var(--color-schedule-accent);
  border-color: var(--color-schedule-accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(136, 180, 212, 0.35);
}
.duration-chip-icon {
  font-size: 14px;
  line-height: 1;
}
.form-row > .form-group { flex: 1; }

.form-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ============================================
   Toast 通知
   ============================================ */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--color-project-a-deep);
  color: var(--text-inverse);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.25s ease;
  max-width: 360px;
}

.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-conflict); }
.toast.info { background: var(--color-info); }
.toast.warning { background: var(--color-cascade); color: var(--text-primary); }

/* ============================================
   数据分析视图
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-trend { font-size: 12px; margin-top: 4px; }
.stat-trend.up { color: var(--color-success); }
.stat-trend.down { color: var(--color-conflict); }

/* ---- 数据分析（按日/周/月/年） ---- */
.analysis-range-bar {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.range-btn {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.range-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.range-btn.active {
  background: linear-gradient(135deg, var(--color-project-a), #F5A8B8);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.range-step-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.analysis-period-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(232,146,159,0.08), rgba(126,196,168,0.06));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}
.analysis-period-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; }
.analysis-period-range { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.analysis-bigstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.bigstat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.bigstat-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; margin-bottom: 8px; }
.bigstat-value { font-size: 30px; font-weight: 700; line-height: 1.1; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.bigstat-delta { font-size: 11px; color: var(--text-tertiary); }
.bigstat-delta .delta-up { color: var(--color-success); font-weight: 700; margin-right: 4px; }
.bigstat-delta .delta-down { color: var(--color-conflict); font-weight: 700; margin-right: 4px; }
.bigstat-delta .sub { color: var(--text-tertiary); }

/* 趋势图 */
.analysis-trend { padding: 12px 6px 6px; }
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
  overflow-x: auto;
}
.trend-col {
  flex: 1;
  min-width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.trend-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 0 2px;
}
.trend-bar {
  flex: 1;
  min-width: 6px;
  border-radius: 4px 4px 0 0;
  transition: all 0.2s;
  cursor: pointer;
}
.trend-bar:hover { transform: scaleY(1.04); filter: brightness(1.05); }
.trend-bar-ep { background: linear-gradient(180deg, var(--color-project-a), #F5A8B8); }
.trend-bar-task { background: linear-gradient(180deg, var(--color-success), #A8D5BA); }
.trend-col-label {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
}

.trend-legend {
  display: flex;
  gap: 16px;
  padding: 10px 4px 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.trend-legend-item { display: flex; align-items: center; gap: 6px; }
.trend-legend-dot {
  width: 14px; height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.trend-summary {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 4px 0;
  font-weight: 500;
}

/* 周期剧集行 */
.analysis-ep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-bottom: 1px dashed var(--border-light);
  font-size: 13px;
}
.analysis-ep-row:last-child { border-bottom: none; }

/* 工作负载行（百分比进度条） */
.analysis-workload-row {
  display: grid;
  grid-template-columns: 110px 70px 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-size: 13px;
  border-bottom: 1px dashed var(--border-light);
}
.analysis-workload-row:last-child { border-bottom: none; }
.workload-bar-wrapper {
  height: 8px;
  background: var(--bg-tag);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.workload-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-project-a), var(--color-success));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ---- 每周复盘 ---- */
.review-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.review-week { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.review-section { margin-bottom: 14px; }
.review-section-title { font-size: 12px; font-weight: 600; color: var(--text-tertiary); margin-bottom: 6px; }
.review-section-content { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ---- 工作日报 ---- */
.daily-report-member {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-card);
}
.daily-report-member:last-child { margin-bottom: 0; }
.daily-report-member-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.daily-report-avatar { font-size: 16px; }
.daily-report-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.daily-report-role { font-size: 12px; color: var(--text-tertiary); }
.daily-report-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-project-a);
  background: var(--bg-tag);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}
.daily-report-day {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 5px 0;
}
.daily-report-date {
  flex-shrink: 0;
  width: 64px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-top: 2px;
}
.daily-report-items { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.daily-report-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.daily-report-check { flex-shrink: 0; font-size: 12px; }
.daily-report-task { color: var(--text-primary); }
.daily-report-ep { color: var(--text-tertiary); font-size: 12px; }

/* ============================================
   空状态
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 14px; }
.empty-state-hint { font-size: 12px; margin-top: 4px; }

/* ============================================
   响应式
   ============================================ */
/* ============================================
   响应式（手机适配）
   ============================================ */

/* 汉堡按钮（默认隐藏，移动端显示） */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  font-size: 22px; color: var(--text-primary);
  border-radius: var(--radius-md);
  cursor: pointer; flex-shrink: 0;
}
.menu-toggle:hover { background: var(--bg-hover); }

/* 侧边栏遮罩（移动端） */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
  animation: fadeIn 0.15s ease;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  /* 汉堡按钮显示 */
  .menu-toggle { display: inline-flex; }

  /* 侧边栏改抽屉：默认隐藏在屏幕左侧外 */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  /* 抽屉里所有内容都显示（不再像旧版那样隐藏） */
  .sidebar-header { justify-content: flex-start; }
  .sidebar-header > div:not(.logo-icon) { display: block; }
  .nav-label, .sidebar-section, .sidebar-footer { display: block; }
  .nav-item { justify-content: flex-start; padding: 9px 12px; }

  /* 主内容全宽 */
  #app { display: block; }
  .main-content { width: 100%; }

  /* 顶栏调整 */
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .tab-bar { flex: 1; }
  .tab { padding: 6px 12px; font-size: 12px; }
  .topbar-actions { gap: 6px; }
  /* 顶栏按钮隐藏文字只留图标，节省空间 */
  .topbar-actions .btn .btn-text { display: none; }
  .topbar-actions .btn { padding: 7px 10px; }
  /* 同步指示器在移动端紧凑显示 */
  .sync-status { padding: 4px 8px; font-size: 11px; }
  .sync-status .sync-dot { width: 6px; height: 6px; }

  /* 视图容器内边距减小 */
  .view-container { padding: 12px; }

  /* 数据统计网格自适应单列 */
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .analysis-bigstats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }

  /* 剧集卡片内边距减小 */
  .episode-header { padding: 12px 14px; }
  .episode-title-area { gap: 8px; }
  .episode-title { font-size: 14px; }

  /* 模态框全屏化 */
  .modal-overlay { align-items: stretch; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    animation: slideUp 0.2s ease;
  }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .modal-confirm, .modal-pick {
    width: 100%; max-width: 100%;
    height: auto; max-height: 100vh;
  }
  /* 模态框内的表单字段堆叠 */
  .form-row { flex-direction: column; gap: 10px; }
  .form-row > * { width: 100% !important; min-width: 0 !important; }

  /* 日历网格字号缩小 */
  .calendar-cell { min-height: 60px; padding: 4px; }
  .calendar-day-num { font-size: 12px; }
  .calendar-event { font-size: 10px; padding: 2px 4px; }

  /* 甘特图 / 任务表格保持横向滚动 */
  .gantt-body, .task-table-wrapper { -webkit-overflow-scrolling: touch; }

  /* Toast 移动端：底部居中、占满宽度 */
  #toastContainer {
    top: auto; bottom: 16px;
    left: 8px; right: 8px;
    align-items: center;
  }
  .toast {
    max-width: 100%;
    font-size: 13px;
    padding: 10px 14px;
  }

  /* Auth gate 适配：用户选择网格改 2 列 */
  .auth-card { padding: 28px 22px; max-width: 360px; }
  .auth-user-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .auth-user-chip { padding: 12px 6px; }
  .auth-user-avatar { font-size: 24px; }
  .auth-user-name { font-size: 12px; }

  /* 触摸友好：按钮最小高度 */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 30px; }
  .nav-item { min-height: 40px; }

  /* duration chip 单选组在移动端换行 */
  .duration-chip-group { flex-wrap: wrap; gap: 6px; }
  .duration-chip { padding: 6px 12px; font-size: 12px; }
}

/* 超小屏幕（≤400px，iPhone SE 等）进一步压缩 */
@media (max-width: 400px) {
  .topbar { padding: 0 8px; }
  .tab { padding: 5px 10px; font-size: 11px; }
  .view-container { padding: 8px; }
  .stat-value { font-size: 18px; }
  .auth-user-grid { grid-template-columns: 1fr; }
  .logo { font-size: 16px; }
  .logo-subtitle { font-size: 10px; }
}

/* ---- 滚动条美化 ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D5D2CD; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #C0BCB6; }

/* ============================================
   访问门（邀请码 + 身份选择）
   ============================================ */
.auth-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #FAF6F4 0%, #F5EDEA 60%, #EFE4E0 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  text-align: center;
}
.auth-card.shake { animation: authShake 0.4s; }
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.auth-step { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.auth-logo { font-size: 44px; }
.auth-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.auth-sub { font-size: 13px; color: var(--text-secondary); }
.auth-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 16px; font-size: 15px; text-align: center; letter-spacing: 2px;
  border: 1.5px solid var(--border-color); border-radius: 12px;
  background: var(--bg-page); outline: none; transition: border-color .2s;
}
.auth-input:focus { border-color: var(--color-project-a); }
.auth-btn { width: 100%; padding: 12px; font-size: 15px; border-radius: 12px; }
.auth-err { font-size: 12px; color: var(--color-conflict); min-height: 16px; }
.auth-user-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; width: 100%; margin-top: 6px;
}
.auth-user-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px; border-radius: 14px;
  border: 1.5px solid var(--border-color); background: var(--bg-page);
  cursor: pointer; transition: all .15s;
}
.auth-user-chip:hover {
  border-color: var(--color-project-a);
  background: #FDF3F4; transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232,146,159,0.25);
}
.auth-user-avatar { font-size: 26px; }
.auth-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.auth-user-role { font-size: 11px; color: var(--text-secondary); }
/* ============================================
   小福馨日程模块（HourlySchedule）样式
   - 全部以 .xfx-hy- 前缀命名，避免污染主项目其他视图
   - 变量定义在 .xfx-hy-root 上，避免污染 :root
   ============================================ */

/* 变量作用域同时覆盖「根视图 .xfx-hy-root」和「弹窗 .xfx-hy-mask」：
   弹窗是挂到 document.body 上的，脱离 .xfx-hy-root，若只在 .xfx-hy-root 上定义变量，
   弹窗里 var(--xfx-bg-card) 等会取不到值 → 背景透明、字看不清。 */
.xfx-hy-root,
.xfx-hy-mask {
  /* 本模块专用变量 */
  --xfx-bg-page: #FAFAF8;
  --xfx-bg-card: #FFFFFF;
  --xfx-bg-soft: #F5F3F0;
  --xfx-bg-hover: #F0EEEB;
  --xfx-border: #E8E5E0;
  --xfx-border-light: #F0EEEB;

  --xfx-text-1: #1C1C1E;
  --xfx-text-2: #6B6B70;
  --xfx-text-3: #9B9BA0;
  --xfx-inverse: #FFFFFF;

  --xfx-accent: #88B4D4;
  --xfx-accent-deep: #5C8FB6;
  --xfx-indep: #A998C9;
  --xfx-indep-deep: #8775B0;
  --xfx-conflict: #E57373;
  --xfx-warning: #FFB74D;

  --xfx-hour-h: 56px;
  --xfx-hour-label-w: 64px;
  --xfx-container-w: 320px;
}

/* 根壳：全屏纵向 flex */
.xfx-hy-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--xfx-bg-page);
  color: var(--xfx-text-1);
  font-size: 14px;
}

/* 预警横幅 */
.xfx-hy-alert {
  background: linear-gradient(180deg, #FFE0B2 0%, #FFD180 100%);
  color: #6D4C00;
  padding: 10px 24px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--xfx-warning);
  flex-shrink: 0;
}
.xfx-hy-alert[hidden] { display: none; }
.xfx-hy-alert .xfx-hy-alert-ic { font-size: 18px; }
.xfx-hy-alert .xfx-hy-alert-detail { color: #8C6D00; font-size: 12px; margin-left: auto; }

/* 顶部栏 */
.xfx-hy-top {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  height: 60px;
  background: var(--xfx-bg-card);
  border-bottom: 1px solid var(--xfx-border);
  flex-shrink: 0;
}
.xfx-hy-top-brand { display: flex; align-items: center; gap: 10px; }
.xfx-hy-top-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #88B4D4, #A998C9);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
}
.xfx-hy-top-title { font-size: 15px; font-weight: 600; letter-spacing: 0.2px; }
.xfx-hy-top-sub { font-size: 11px; color: var(--xfx-text-3); }
.xfx-hy-top .xfx-hy-spacer { flex: 1; }

.xfx-hy-date-nav {
  display: flex; align-items: center; gap: 4px;
  background: var(--xfx-bg-soft);
  border-radius: 999px; padding: 4px;
}
.xfx-hy-date-nav button {
  width: 28px; height: 28px;
  border-radius: 999px;
  color: var(--xfx-text-2);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.xfx-hy-date-nav button:hover { background: var(--xfx-bg-hover); }
.xfx-hy-date-nav .xfx-hy-date-label {
  padding: 0 12px;
  font-size: 13px; font-weight: 500;
  color: var(--xfx-text-1);
  min-width: 110px; text-align: center;
}

.xfx-hy-actions { display: flex; align-items: center; gap: 8px; }
.xfx-hy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: inherit;
  font-family: inherit;
}
.xfx-hy-btn.xfx-hy-btn-primary { background: var(--color-project-a); color: var(--xfx-inverse); }
.xfx-hy-btn.xfx-hy-btn-primary:hover { background: var(--color-project-a-deep); }
.xfx-hy-btn.xfx-hy-btn-ghost { background: var(--xfx-bg-card); color: var(--xfx-text-1); border-color: var(--xfx-border); }
.xfx-hy-btn.xfx-hy-btn-ghost:hover { background: var(--xfx-bg-soft); }
.xfx-hy-btn.xfx-hy-btn-danger { background: var(--xfx-conflict); color: var(--xfx-inverse); }
.xfx-hy-btn.xfx-hy-btn-danger:hover { background: #D85959; }
.xfx-hy-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* 主区域 */
.xfx-hy-main {
  flex: 1; display: flex;
  overflow: hidden; min-height: 0;
}

/* 左侧容器列表 */
.xfx-hy-containers {
  width: var(--xfx-container-w);
  border-right: 1px solid var(--xfx-border);
  background: var(--xfx-bg-card);
  overflow-y: auto;
  padding: 16px 14px 24px;
  flex-shrink: 0;
}
.xfx-hy-containers h3 {
  font-size: 11px; font-weight: 600; color: var(--xfx-text-3);
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 4px 6px 10px;
}
.xfx-hy-empty-tip {
  padding: 20px 8px; text-align: center;
  font-size: 12px; color: var(--xfx-text-3);
}
.xfx-hy-group { margin-bottom: 14px; }
.xfx-hy-group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; cursor: pointer; user-select: none;
}
.xfx-hy-group-head:hover { background: var(--xfx-bg-soft); border-radius: 6px; }
.xfx-hy-group-head .xfx-hy-chevron {
  width: 12px; transition: transform 0.15s;
  color: var(--xfx-text-3); font-size: 10px;
}
.xfx-hy-group.collapsed .xfx-hy-chevron { transform: rotate(-90deg); }
.xfx-hy-group.collapsed .xfx-hy-group-body { display: none; }
.xfx-hy-group-title {
  font-size: 12px; font-weight: 600; color: var(--xfx-text-2);
  letter-spacing: 0.5px; flex: 1;
}
.xfx-hy-group-count {
  font-size: 11px; color: var(--xfx-text-3);
  background: var(--xfx-bg-soft);
  border-radius: 999px; padding: 1px 8px;
}

/* 容器卡片 */
.xfx-hy-c {
  background: var(--xfx-bg-card);
  border: 1px solid var(--xfx-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.15s;
  position: relative;
}
.xfx-hy-c:hover { border-color: var(--xfx-accent-deep); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.xfx-hy-c:active { cursor: grabbing; }
.xfx-hy-c.dragging { opacity: 0.5; }
.xfx-hy-c-stripe {
  position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 3px 3px 0;
}
.xfx-hy-c[data-color="1"] .xfx-hy-c-stripe { background: var(--xfx-accent); }
.xfx-hy-c[data-color="2"] .xfx-hy-c-stripe { background: #E8929F; }
.xfx-hy-c[data-color="3"] .xfx-hy-c-stripe { background: #E5C088; }
.xfx-hy-c-name {
  font-size: 13px; font-weight: 500; color: var(--xfx-text-1);
  margin-bottom: 6px; padding-left: 8px;
  word-break: break-all;
}
.xfx-hy-c-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--xfx-text-3);
  padding-left: 8px;
  flex-wrap: wrap;
}
.xfx-hy-c-meta .xfx-hy-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--xfx-bg-soft);
}
.xfx-hy-c-progress {
  height: 4px; border-radius: 999px;
  background: var(--xfx-bg-soft);
  margin: 8px 0 8px 8px;
  overflow: hidden;
}
.xfx-hy-c-progress .xfx-hy-bar {
  height: 100%; border-radius: 999px;
  background: var(--xfx-accent);
  transition: width 0.3s;
}
.xfx-hy-c[data-status="pending"] .xfx-hy-bar { background: var(--xfx-text-3); }
.xfx-hy-c-actions {
  display: flex; gap: 6px;
  padding-left: 8px; margin-top: 4px;
}
.xfx-hy-c-actions .xfx-hy-btn {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  flex: 1;
  justify-content: center;
}
.xfx-hy-c-status {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; padding: 2px 6px;
  border-radius: 4px; font-weight: 500;
}
.xfx-hy-c[data-status="pending"] .xfx-hy-c-status { background: #F5F3F0; color: var(--xfx-text-3); }
.xfx-hy-c[data-status="partial"] .xfx-hy-c-status { background: #E3F2FD; color: #1976D2; }
.xfx-hy-c[data-status="split"]   .xfx-hy-c-status { background: #E8F5E9; color: #388E3C; }

/* 右侧时间轴 */
.xfx-hy-tl-area {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0;
}
.xfx-hy-tl-head {
  padding: 14px 24px;
  border-bottom: 1px solid var(--xfx-border);
  background: var(--xfx-bg-card);
  display: flex; align-items: center; gap: 12px;
}
.xfx-hy-tl-day { font-size: 17px; font-weight: 600; }
.xfx-hy-tl-meta { font-size: 12px; color: var(--xfx-text-3); }
.xfx-hy-tl-stat {
  font-size: 12px; color: var(--xfx-text-3);
  margin-left: auto;
}
.xfx-hy-tl-wrap {
  flex: 1; overflow-y: auto;
  background: var(--xfx-bg-page);
  position: relative;
}
.xfx-hy-tl-grid {
  position: relative;
  padding: 0 24px 32px;
}

.xfx-hy-hour-row {
  display: flex; align-items: stretch;
  height: var(--xfx-hour-h);
  border-bottom: 1px solid var(--xfx-border-light);
  position: relative;
}
.xfx-hy-hour-row:last-of-type { border-bottom: 1px dashed var(--xfx-border); }
.xfx-hy-hour-label {
  width: var(--xfx-hour-label-w);
  font-size: 11px; color: var(--xfx-text-3);
  padding-top: 6px; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.xfx-hy-hour-cell {
  flex: 1; position: relative;
  border-left: 1px solid var(--xfx-border-light);
  transition: background 0.1s;
}
.xfx-hy-hour-cell.drop-hover {
  background: rgba(136, 180, 212, 0.12);
}
.xfx-hy-eod {
  position: relative;
  left: var(--xfx-hour-label-w);
  right: 0;
  margin-top: -8px;
  padding: 0 24px 0 0;
  font-size: 11px; color: var(--xfx-text-3);
  text-align: right;
}
.xfx-hy-eod .xfx-hy-pill-eod {
  display: inline-block;
  padding: 2px 10px;
  background: var(--xfx-bg-soft);
  border-radius: 999px;
  margin-top: -10px;
}

/* 加班时段（19–23）视觉区分：背景略深 + 标签字色淡化 */
.xfx-hy-hour-row-eod {
  background: linear-gradient(180deg, rgba(229, 192, 136, 0.04) 0%, rgba(229, 192, 136, 0.08) 100%);
}
.xfx-hy-hour-row-eod .xfx-hy-hour-label {
  color: #B49A6E;
  font-weight: 400;
}
.xfx-hy-hour-row-eod .xfx-hy-hour-cell {
  border-left-color: rgba(229, 192, 136, 0.18);
}
.xfx-hy-hour-row-eod .xfx-hy-hour-cell.drop-hover {
  background: rgba(229, 192, 136, 0.18);
}

/* 时间块 */
.xfx-hy-tb {
  position: absolute;
  left: calc(var(--xfx-hour-label-w) + 24px);
  right: 24px;
  background: var(--xfx-bg-card);
  border: 1px solid var(--xfx-accent-deep);
  border-left: 4px solid var(--xfx-accent);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  z-index: 3;
  transition: all 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.xfx-hy-tb:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.xfx-hy-tb.xfx-hy-tb-indep {
  border-color: var(--xfx-indep-deep);
  border-left-color: var(--xfx-indep);
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFAFD 100%);
}
.xfx-hy-tb.xfx-hy-tb-done {
  opacity: 0.5;
  text-decoration: line-through;
}
.xfx-hy-tb.xfx-hy-tb-conflict {
  border-color: var(--xfx-conflict);
  border-left-color: var(--xfx-conflict);
  background: linear-gradient(180deg, #FFEBEE 0%, #FFFFFF 100%);
  animation: xfx-hy-shake 0.3s ease;
}
.xfx-hy-tb-name {
  font-size: 13px; font-weight: 500;
  color: var(--xfx-text-1);
  line-height: 1.3;
}
.xfx-hy-tb-time {
  font-size: 11px;
  color: var(--xfx-text-2);
  font-variant-numeric: tabular-nums;
}
.xfx-hy-tb.xfx-hy-tb-done .xfx-hy-tb-name,
.xfx-hy-tb.xfx-hy-tb-done .xfx-hy-tb-time { color: var(--xfx-text-3); }

@keyframes xfx-hy-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* 日 / 周视图切换 */
.xfx-hy-view-toggle {
  display: flex;
  border: 1px solid var(--xfx-border);
  border-radius: 8px;
  overflow: hidden;
  margin-right: 6px;
}
.xfx-hy-view-toggle button {
  border: none;
  background: var(--xfx-bg-card);
  color: var(--xfx-text-2);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.xfx-hy-view-toggle button + button { border-left: 1px solid var(--xfx-border-light); }
.xfx-hy-view-toggle button.on {
  background: var(--xfx-accent);
  color: #FFFFFF;
  font-weight: 600;
}

/* 周视图 */
.xfx-hy-wk-head {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--xfx-border);
  background: var(--xfx-bg-card);
  position: sticky;
  top: 0;
  z-index: 5;
}
.xfx-hy-wk-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 0;
  border-left: 1px solid var(--xfx-border-light);
}
.xfx-hy-wk-day.is-today { background: var(--xfx-bg-soft); }
.xfx-hy-wk-dow { font-size: 11px; color: var(--xfx-text-3); }
.xfx-hy-wk-date { font-size: 13px; font-weight: 600; color: var(--xfx-text-1); font-variant-numeric: tabular-nums; }
.xfx-hy-wk-day.is-today .xfx-hy-wk-dow,
.xfx-hy-wk-day.is-today .xfx-hy-wk-date { color: var(--xfx-accent); }
.xfx-hy-wk-body { display: flex; position: relative; }
.xfx-hy-wk-labels { width: var(--xfx-hour-label-w); flex-shrink: 0; }
.xfx-hy-wk-labels div {
  height: var(--xfx-hour-h);
  font-size: 11px; color: var(--xfx-text-3);
  padding-top: 6px;
  font-variant-numeric: tabular-nums;
}
.xfx-hy-wk-cols { flex: 1; display: flex; }
.xfx-hy-wk-col {
  flex: 1;
  position: relative;
  border-left: 1px solid var(--xfx-border-light);
  display: flex;
  flex-direction: column;
}
.xfx-hy-wk-col:last-child { border-right: 1px solid var(--xfx-border-light); }
.xfx-hy-wk-col.is-today { background: rgba(136, 180, 212, 0.06); }
.xfx-hy-wk-col .xfx-hy-hour-cell {
  flex: none;
  height: var(--xfx-hour-h);
  border-left: none;
  border-bottom: 1px solid var(--xfx-border-light);
}
.xfx-hy-wk-col .xfx-hy-hour-cell:last-child { border-bottom: 1px dashed var(--xfx-border); }
.xfx-hy-tb-mini {
  padding: 3px 6px;
  gap: 1px;
  border-radius: 6px;
  border-left-width: 3px;
  left: 3px;
  right: 3px;
}
.xfx-hy-tb-mini .xfx-hy-tb-name { font-size: 11px; line-height: 1.25; }
.xfx-hy-tb-mini .xfx-hy-tb-time { font-size: 10px; font-variant-numeric: tabular-nums; }

/* ---- 周视图 mini 任务块：项目归属行 + 项目色左边条 ----
   v3.8.2：项目行文字统一深灰（密集界面彩色字看不清），项目区分只靠左侧色条 */
.xfx-hy-tb-proj {
  font-size: 10px;
  font-weight: 600;
  color: #5C5750;
  line-height: 1.2;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* v3.8.3：周视图任务块边框色改由 app.js 按剧集内联注入（EPISODE_PALETTE），
   冲突红 / 独立紫仍走 class 样式，此处不再需要按项目分色的规则 */


/* 导入弹窗：已完成任务置灰 */
.xfx-hy-imp-task-done {
  opacity: 0.55;
  cursor: default;
  background: var(--xfx-bg-soft);
}
.xfx-hy-imp-task-done .xfx-hy-imp-task-name { text-decoration: line-through; }

/* 容器移除按钮 */
.xfx-hy-btn-remove { color: var(--xfx-conflict); }
.xfx-hy-btn-remove:hover { border-color: var(--xfx-conflict); }

/* 弹窗 */
.xfx-hy-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.32);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  animation: xfx-hy-fade 0.15s ease;
}
@keyframes xfx-hy-fade { from{opacity:0} to{opacity:1} }

.xfx-hy-modal {
  background: var(--xfx-bg-card);
  border-radius: 14px;
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.10);
  animation: xfx-hy-pop 0.18s ease;
}
.xfx-hy-modal.xfx-hy-modal-wide { width: 520px; }
@keyframes xfx-hy-pop { from{transform: scale(0.96); opacity:0} to{transform: scale(1); opacity:1} }

.xfx-hy-modal-head { padding: 18px 20px 4px; }
.xfx-hy-modal-head .xfx-hy-modal-title { font-size: 16px; font-weight: 600; }
.xfx-hy-modal-head .xfx-hy-modal-sub { font-size: 12px; color: var(--xfx-text-3); margin-top: 4px; }

.xfx-hy-modal-body { padding: 16px 20px; }
.xfx-hy-modal-foot {
  padding: 12px 20px 16px;
  display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--xfx-border-light);
}
.xfx-hy-modal-foot.xfx-hy-modal-foot-split { justify-content: space-between; }

.xfx-hy-field { margin-bottom: 16px; }
.xfx-hy-field label {
  display: block; font-size: 12px; color: var(--xfx-text-2);
  margin-bottom: 6px; font-weight: 500;
}
.xfx-hy-field input[type="text"],
.xfx-hy-field input[type="date"],
.xfx-hy-field select {
  width: 100%; height: 36px;
  border: 1px solid var(--xfx-border);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--xfx-bg-card);
  font-family: inherit; font-size: inherit; color: inherit;
}
.xfx-hy-field input:focus,
.xfx-hy-field select:focus {
  outline: none; border-color: var(--xfx-accent-deep);
  box-shadow: 0 0 0 3px rgba(136,180,212,0.18);
}

/* 小时格子（拆解弹窗） */
.xfx-hy-hours {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.xfx-hy-hour-pill {
  height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--xfx-border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  background: var(--xfx-bg-card);
  transition: all 0.15s;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.xfx-hy-hour-pill:hover { border-color: var(--xfx-accent-deep); }
.xfx-hy-hour-pill.xfx-hy-on {
  background: var(--xfx-accent-deep);
  color: var(--xfx-inverse);
  border-color: var(--xfx-accent-deep);
}

.xfx-hy-stats {
  background: var(--xfx-bg-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px; color: var(--xfx-text-2);
  display: flex; justify-content: space-between;
  margin-bottom: 12px;
}
.xfx-hy-stats .xfx-hy-num { color: var(--xfx-text-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.xfx-hy-warn {
  font-size: 11px;
  margin-top: 8px;
  color: var(--xfx-conflict);
}
.xfx-hy-warn[hidden] { display: none; }
.xfx-hy-hint {
  font-size: 11px;
  margin-top: 6px;
  color: var(--xfx-text-3);
}

/* 下班确认 */
.xfx-hy-eod-list { max-height: 400px; overflow-y: auto; }
.xfx-hy-eod-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 8px;
  margin-bottom: 6px;
  background: var(--xfx-bg-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.xfx-hy-eod-item:hover { background: var(--xfx-bg-hover); }
.xfx-hy-eod-item .xfx-hy-check {
  width: 22px; height: 22px;
  border: 1.5px solid var(--xfx-border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--xfx-bg-card);
  flex-shrink: 0;
  transition: all 0.15s;
}
.xfx-hy-eod-item.xfx-hy-eod-done .xfx-hy-check {
  background: var(--xfx-accent-deep);
  border-color: var(--xfx-accent-deep);
  color: var(--xfx-inverse);
}
.xfx-hy-eod-item .xfx-hy-info { flex: 1; min-width: 0; }
.xfx-hy-eod-item .xfx-hy-info .xfx-hy-name {
  font-size: 13px; font-weight: 500; line-height: 1.3; word-break: break-all;
}
.xfx-hy-eod-item .xfx-hy-info .xfx-hy-desc {
  font-size: 11px; color: var(--xfx-text-3); margin-top: 2px;
}
.xfx-hy-eod-item .xfx-hy-info .xfx-hy-delay {
  font-size: 11px; color: var(--xfx-warning);
  margin-top: 4px;
  background: rgba(255,183,77,0.15);
  padding: 2px 8px; border-radius: 4px;
  display: inline-block;
}
.xfx-hy-eod-item .xfx-hy-time-pill {
  font-size: 11px; color: var(--xfx-text-3);
  font-variant-numeric: tabular-nums;
  background: var(--xfx-bg-card);
  padding: 4px 8px; border-radius: 999px;
  flex-shrink: 0;
}

.xfx-hy-eod-summary {
  padding: 12px 14px;
  background: var(--xfx-bg-soft);
  border-radius: 8px;
  font-size: 12px; color: var(--xfx-text-2);
  margin-bottom: 10px;
}
.xfx-hy-eod-summary .xfx-hy-row {
  display: flex; justify-content: space-between; margin-bottom: 4px;
}
.xfx-hy-eod-summary .xfx-hy-row:last-child { margin-bottom: 0; }
.xfx-hy-eod-summary .xfx-hy-row .xfx-hy-num {
  font-weight: 600; color: var(--xfx-text-1); font-variant-numeric: tabular-nums;
}
.xfx-hy-eod-summary .xfx-hy-warn-row .xfx-hy-num { color: var(--xfx-conflict); }

/* 滚动条 */
.xfx-hy-containers::-webkit-scrollbar,
.xfx-hy-tl-wrap::-webkit-scrollbar,
.xfx-hy-modal::-webkit-scrollbar,
.xfx-hy-eod-list::-webkit-scrollbar { width: 8px; }
.xfx-hy-containers::-webkit-scrollbar-thumb,
.xfx-hy-tl-wrap::-webkit-scrollbar-thumb,
.xfx-hy-modal::-webkit-scrollbar-thumb,
.xfx-hy-eod-list::-webkit-scrollbar-thumb { background: #DAD7D2; border-radius: 4px; }
.xfx-hy-containers::-webkit-scrollbar-thumb:hover,
.xfx-hy-tl-wrap::-webkit-scrollbar-thumb:hover,
.xfx-hy-modal::-webkit-scrollbar-thumb:hover,
.xfx-hy-eod-list::-webkit-scrollbar-thumb:hover { background: #B8B5B0; }

/* ============================================
   从项目层导入弹窗专用样式
   ============================================ */
.xfx-hy-containers-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 6px 6px;
}
.xfx-hy-containers-head h3 { flex: 1; padding: 0; margin: 0; }

.xfx-hy-btn.xfx-hy-btn-import {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--xfx-bg-soft);
  color: var(--xfx-text-1);
  border: 1px solid var(--xfx-border);
  border-radius: 999px;
}
.xfx-hy-btn.xfx-hy-btn-import:hover {
  background: var(--xfx-bg-hover);
  border-color: var(--xfx-accent-deep);
}

/* 导入弹窗 - 业务线 tabs */
.xfx-hy-imp-tabs {
  display: flex; gap: 6px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--xfx-border-light);
  background: var(--xfx-bg-soft);
  overflow-x: auto;
}
.xfx-hy-imp-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--xfx-bg-card);
  border: 1px solid var(--xfx-border);
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.15s;
}
.xfx-hy-imp-tab:hover { border-color: var(--xfx-accent-deep); }
.xfx-hy-imp-tab.xfx-hy-imp-tab-on {
  background: var(--color-project-a);
  color: var(--xfx-inverse);
  border-color: var(--color-project-a);
}
.xfx-hy-imp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.xfx-hy-imp-tab-count {
  font-size: 10px;
  opacity: 0.7;
}

/* 导入弹窗 - 剧集 + 任务列表 */
.xfx-hy-imp-list {
  max-height: 460px;
  overflow-y: auto;
  padding: 8px 16px 16px;
}
.xfx-hy-imp-ep {
  margin-bottom: 8px;
  border: 1px solid var(--xfx-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--xfx-bg-card);
}
.xfx-hy-imp-ep-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--xfx-bg-soft);
  user-select: none;
}
.xfx-hy-imp-ep-head:hover { background: var(--xfx-bg-hover); }
.xfx-hy-imp-ep-chevron {
  font-size: 10px;
  color: var(--xfx-text-3);
  transition: transform 0.15s;
  width: 10px;
  flex-shrink: 0;
}
.xfx-hy-imp-ep.collapsed .xfx-hy-imp-ep-chevron { transform: rotate(-90deg); }
.xfx-hy-imp-ep-title {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}
.xfx-hy-imp-ep-count {
  font-size: 11px;
  color: var(--xfx-text-3);
  background: var(--xfx-bg-card);
  padding: 2px 8px;
  border-radius: 999px;
}
.xfx-hy-imp-ep-all {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--xfx-bg-card);
  color: var(--xfx-text-2);
  border: 1px solid var(--xfx-border);
  cursor: pointer;
  font-family: inherit;
}
.xfx-hy-imp-ep-all:hover {
  background: var(--xfx-accent-deep);
  color: var(--xfx-inverse);
  border-color: var(--xfx-accent-deep);
}
.xfx-hy-imp-ep-body { padding: 0; }
.xfx-hy-imp-ep.collapsed .xfx-hy-imp-ep-body { display: none; }

.xfx-hy-imp-task {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border-top: 1px solid var(--xfx-border-light);
}
.xfx-hy-imp-task:first-child { border-top: none; }
.xfx-hy-imp-task:hover { background: var(--xfx-bg-soft); }
.xfx-hy-imp-task.xfx-hy-imp-task-on {
  background: rgba(136, 180, 212, 0.10);
}
.xfx-hy-imp-task input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}
.xfx-hy-imp-task-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}
.xfx-hy-imp-task-meta {
  font-size: 11px;
  color: var(--xfx-text-3);
  flex-shrink: 0;
}

/* ============================================
   成员编辑按钮（sidebar 底部）+ 成员编辑弹窗样式
   ============================================ */
.btn-members-edit {
  display: block;
  width: calc(100% - 28px);
  margin: 10px 14px 14px;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-members-edit:hover {
  background: var(--bg-tag);
  border-color: var(--color-schedule-accent, #88B4D4);
}

/* 弹窗内部成员编辑区 */
.member-edit-hint {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
  background: var(--bg-tag);
  border-radius: 6px;
}
.member-edit-list { margin-bottom: 14px; }
.member-edit-row {
  display: grid;
  grid-template-columns: 50px 60px 1fr 1fr 46px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.member-edit-row:last-child { border-bottom: none; }
.member-edit-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-tag);
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.member-edit-avatar,
.member-edit-name,
.member-edit-role {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s;
}
.member-edit-avatar { text-align: center; font-size: 16px; }
.member-edit-name { font-weight: 500; }
.member-edit-role { font-size: 12px; color: var(--text-secondary); }
.member-edit-avatar:focus,
.member-edit-name:focus,
.member-edit-role:focus {
  outline: none;
  border-color: var(--color-schedule-accent, #88B4D4);
  box-shadow: 0 0 0 3px rgba(136,180,212,0.18);
}
.member-edit-del {
  padding: 4px 8px;
  font-size: 11px;
  align-self: center;
  white-space: nowrap;
  text-align: center;
}
.member-edit-add {
  margin-bottom: 12px;
  align-self: flex-start;
}
.member-edit-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.member-edit-preset-btn {
  font-size: 11px;
  height: 28px;
  padding: 0 10px;
}


