/* 杆杆响智慧助手 — 任务协同样式 */
/* 与 dashboard.css 保持统一的深色主题设计风格 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* 继承深色主题配色 */
  --bg: #1a1a2e;
  --bg-surface: #16213e;
  --bg-card: #0f3460;
  --text: #e6e6e6;
  --text-muted: #a0a0b0;
  --accent: #e94560;
  --accent-light: #ff6b81;
  --border: #2a2a4a;
  
  /* 状态颜色 */
  --status-backlog: #6b7280;
  --status-pending: #3b82f6;
  --status-inprogress: #f59e0b;
  --status-blocked: #ef4444;
  --status-review: #8b5cf6;
  --status-done: #10b981;
  --status-canceled: #4b5563;
  
  /* 优先级颜色 */
  --priority-p0: #ef4444;
  --priority-p1: #f97316;
  --priority-p2: #eab308;
  --priority-p3: #6b7280;
}

html, body { 
  height: 100%; 
  font-family: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; 
  background: var(--bg); 
  color: var(--text); 
  overflow: hidden;
}

/* ===== Header / Navigation ===== */
#header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  height: 52px; 
  padding: 0 16px;
  background: var(--bg-surface); 
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

#header h1 { 
  font-size: 16px; 
  font-weight: 600; 
  white-space: nowrap; 
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-nav { display: flex; gap: 4px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.nav-link {
  padding: 8px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { 
  color: var(--accent); 
  background: rgba(233, 69, 96, 0.15); 
  font-weight: 500;
}

/* ===== Buttons ===== */
.btn-icon { 
  background: var(--bg-card); 
  color: var(--text); 
  font-size: 16px; 
  width: 36px; 
  height: 36px; 
  padding: 0; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--border); }

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--accent-light); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--border); }

.btn-text {
  background: none;
  color: var(--accent);
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}
.btn-text:hover { text-decoration: underline; }

/* ===== 主布局 ===== */
.tasks-layout {
  display: flex;
  height: calc(100vh - 52px);
}

/* ===== 侧边栏 ===== */
.tasks-sidebar {
  width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sidebar-header h3 {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-section {
  margin-bottom: 16px;
}

.filter-section label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.filter-section select,
.filter-section input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.filter-section select:focus,
.filter-section input:focus {
  border-color: var(--accent);
}

/* ===== select optgroup 分组样式 ===== */
.filter-section select,
.form-group select {
  /* 适配更多选项的下拉高度 */
  max-height: 400px;
}

.filter-section select optgroup,
.form-group select optgroup {
  background: var(--bg-surface);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 0;
  text-transform: none;
  font-style: normal;
}

.filter-section select option,
.form-group select option {
  background: var(--bg-card);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 400;
  font-size: 13px;
}

/* optgroup 内的 option 缩进 */
.filter-section select optgroup option,
.form-group select optgroup option {
  padding-left: 16px;
}

.filter-section select option:hover,
.form-group select option:hover {
  background: rgba(233, 69, 96, 0.2);
}

.filter-section select option:checked,
.form-group select option:checked {
  background: var(--accent);
  color: white;
}

.filter-section input[type="date"] {
  margin-bottom: 8px;
}

/* 时间范围快捷按钮 */
.date-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.date-quick-btn {
  flex: 1;
  min-width: calc(50% - 3px);
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.date-quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.date-quick-btn:active {
  background: rgba(233, 69, 96, 0.1);
}

/* ===== 主内容区 ===== */
.tasks-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== 统计展示栏（第一行，不可点击） ===== */
.stats-info-bar {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.stats-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  min-width: 80px;
}

.stats-info-item.warning.has-overdue {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.stats-info-item.warning.has-overdue .stats-info-value {
  color: #ef4444;
}

.stats-info-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stats-info-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== 状态标签页Tab栏（第二行，可点击） ===== */
.status-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 20px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.status-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.status-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.status-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.status-tab .tab-label {
  font-weight: 500;
}

.status-tab .tab-count {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.status-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== 工具栏 ===== */
.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-center {
  flex: 1;
  justify-content: center;
}

/* 视图切换 */
.view-switcher {
  display: flex;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover {
  color: var(--text);
}

.view-btn.active {
  background: var(--accent);
  color: white;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 400px;
  width: 100%;
}

.search-box input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.search-box button:hover {
  border-color: var(--accent);
}

/* ===== 视图内容区 ===== */
.view-content {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
}

.view-content.active {
  display: flex;
}

/* ===== 列表视图 ===== */
.task-table-container {
  flex: 1;
  overflow: auto;
  padding: 0 20px;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.task-table thead th {
  background: rgba(15, 52, 96, 0.6);
  padding: 14px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.task-table thead th:hover {
  background: rgba(233, 69, 96, 0.1);
}

.task-table thead th.sortable::after {
  content: '⇅';
  margin-left: 6px;
  opacity: 0.4;
  font-size: 12px;
}

.task-table thead th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--accent);
}

.task-table thead th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--accent);
}

.task-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.task-table tbody tr {
  cursor: pointer;
  transition: background 0.2s;
}

.task-table tbody tr:hover {
  background: rgba(233, 69, 96, 0.1);
}

.task-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-name {
  font-weight: 500;
}

/* ===== 状态标签 ===== */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.status-backlog {
  background: rgba(107, 114, 128, 0.2);
  color: var(--status-backlog);
}

.status-badge.status-pending {
  background: rgba(59, 130, 246, 0.2);
  color: var(--status-pending);
}

.status-badge.status-inprogress {
  background: rgba(245, 158, 11, 0.2);
  color: var(--status-inprogress);
}

.status-badge.status-blocked {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-blocked);
}

.status-badge.status-review {
  background: rgba(139, 92, 246, 0.2);
  color: var(--status-review);
}

.status-badge.status-done {
  background: rgba(16, 185, 129, 0.2);
  color: var(--status-done);
}

.status-badge.status-canceled {
  background: rgba(75, 85, 99, 0.2);
  color: var(--status-canceled);
}

/* ===== 优先级标签 ===== */
.priority-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.priority-badge.priority-p0 {
  background: rgba(239, 68, 68, 0.2);
  color: var(--priority-p0);
}

.priority-badge.priority-p1 {
  background: rgba(249, 115, 22, 0.2);
  color: var(--priority-p1);
}

.priority-badge.priority-p2 {
  background: rgba(234, 179, 8, 0.2);
  color: var(--priority-p2);
}

.priority-badge.priority-p3 {
  background: rgba(107, 114, 128, 0.2);
  color: var(--priority-p3);
}

/* ===== 逾期标记 ===== */
.overdue-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 11px;
  border-radius: 10px;
  font-weight: 500;
}

.text-danger {
  color: #ef4444;
}

/* ===== 操作按钮 ===== */
.btn-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
  transition: all 0.2s;
}

.btn-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== 看板视图 ===== */
.board-container {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  overflow-x: auto;
  height: 100%;
}

.board-column {
  flex: 1;
  min-width: 280px;
  max-width: 320px;
  background: var(--bg-surface);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 52, 96, 0.3);
  border-radius: 12px 12px 0 0;
}

.column-title {
  font-size: 14px;
  font-weight: 500;
}

.column-count {
  background: var(--bg-card);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.column-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.column-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 13px;
}

/* ===== 任务卡片 ===== */
.task-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  cursor: grab;
  transition: all 0.2s;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: var(--accent);
}

.task-card.overdue {
  border-color: rgba(239, 68, 68, 0.5);
}

.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.card-assignee {
  display: flex;
  align-items: center;
  gap: 4px;
}

.overdue-indicator {
  font-size: 14px;
}

/* ===== 拖拽状态 ===== */
.board-column.drag-over {
  background: rgba(233, 69, 96, 0.1);
  border-color: var(--accent);
}

.board-column.drag-over .column-content {
  background: rgba(233, 69, 96, 0.05);
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-surface);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== 表单 ===== */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  flex: 1;
}

.form-group.full-width {
  flex: 1 1 100%;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--accent);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===== 详情网格 ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: span 2;
}

.detail-item label {
  font-size: 12px;
  color: var(--text-muted);
}

.detail-item .value {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
}

/* ===== Scrollbar ===== */
.tasks-sidebar::-webkit-scrollbar,
.task-table-container::-webkit-scrollbar,
.column-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.tasks-sidebar::-webkit-scrollbar-track,
.task-table-container::-webkit-scrollbar-track,
.column-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.tasks-sidebar::-webkit-scrollbar-thumb,
.task-table-container::-webkit-scrollbar-thumb,
.column-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.tasks-sidebar::-webkit-scrollbar-thumb:hover,
.task-table-container::-webkit-scrollbar-thumb:hover,
.column-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== 响应式布局 ===== */
@media (max-width: 1200px) {
  .board-container {
    overflow-x: auto;
  }
  
  .board-column {
    min-width: 260px;
  }
}

/* ===== 进度条样式 ===== */
.progress-bar-wrapper {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-wrapper.small {
  height: 4px;
}

.progress-bar-wrapper.large {
  height: 10px;
  border-radius: 5px;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* 进度颜色：<30% 红色, 30-70% 黄色, >70% 绿色 */
.progress-bar.progress-low {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-bar.progress-medium {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.progress-bar.progress-high {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* 表格中的进度单元格 */
.progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* 卡片中的进度 */
.card-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.progress-text-small {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 30px;
}

/* 详情页中的进度 */
.detail-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.progress-text-large {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* 表单中的进度输入 */
.progress-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-input-wrapper input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.progress-input-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.progress-input-wrapper input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.progress-input-wrapper input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.progress-number-input {
  width: 60px !important;
  flex: none !important;
  text-align: center;
  padding: 6px 8px !important;
}

.progress-percent {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== 检查清单样式 ===== */
.checklist-container {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg-card);
  max-height: 300px;
  overflow-y: auto;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item .checklist-checkbox {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-item .checklist-text {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
}

.checklist-item .checklist-text:focus {
  border-color: var(--accent);
  outline: none;
}

.checklist-item.readonly .checklist-text {
  border: none;
  padding: 0;
  background: none;
}

.checklist-item .checklist-text.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-item .btn-remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.checklist-item .btn-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.checklist-item .drag-handle {
  color: var(--text-muted);
  cursor: grab;
  padding: 0 4px;
}

.btn-add-checklist {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: rgba(233, 69, 96, 0.1);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-checklist:hover {
  background: rgba(233, 69, 96, 0.2);
}

.checklist-progress {
  font-size: 12px;
  color: var(--accent);
  margin-left: 8px;
  font-weight: normal;
}

/* 详情页检查清单区域 */
.detail-checklist-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-checklist-section h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ===== 模板管理样式 ===== */
.template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.template-item:hover {
  border-color: var(--accent);
}

.template-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.template-name {
  font-weight: 500;
  color: var(--text);
}

.template-dept {
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent);
  border-radius: 10px;
}

.template-checklist-count {
  font-size: 12px;
  color: var(--text-muted);
}

.template-edit-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.template-edit-section h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* 宽弹窗 */
.modal-content.modal-wide {
  max-width: 700px;
}

/* 删除按钮红色 */
.btn-action.btn-delete {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-action.btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

@media (max-width: 1024px) {
  .tasks-sidebar {
    width: 200px;
  }
  
  .stats-info-bar {
    flex-wrap: wrap;
  }
  
  .stats-info-item {
    min-width: 70px;
    padding: 6px 12px;
  }
  
  .stats-info-value {
    font-size: 18px;
  }
  
  .status-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .detail-item.full-width {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .tasks-layout {
    flex-direction: column;
  }
  
  .tasks-sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
  }
  
  .sidebar-header {
    width: 100%;
    margin-bottom: 12px;
  }
  
  .filter-section {
    flex: 1;
    min-width: 140px;
    margin-bottom: 8px;
  }
  
  .header-nav {
    display: none;
  }
  
  .tasks-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .toolbar-left,
  .toolbar-center,
  .toolbar-right {
    width: 100%;
    justify-content: center;
  }
  
  .search-box {
    max-width: none;
  }
  
  .view-switcher {
    width: 100%;
    justify-content: center;
  }
  
  .btn-primary {
    width: 100%;
    justify-content: center;
  }
  
  .board-column {
    min-width: 240px;
  }
  
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .stats-info-bar {
    padding: 8px 12px;
    gap: 8px;
  }
  
  .stats-info-item {
    min-width: 60px;
    padding: 6px 10px;
  }
  
  .stats-info-value {
    font-size: 16px;
  }
  
  .stats-info-label {
    font-size: 10px;
  }
  
  .status-tabs {
    padding: 6px 12px 10px;
  }
  
  .status-tab {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .task-table {
    font-size: 13px;
  }
  
  .task-table thead th,
  .task-table tbody td {
    padding: 10px 12px;
  }
  
  .pagination {
    flex-wrap: wrap;
    padding: 12px;
  }
  
  .board-column {
    min-width: 220px;
  }
}
