/* 工作待办专属样式 - 从 work-todo.html 抽出 */
:root {
  --bg-primary: #f5f6fa;
  --bg-secondary: #ffffff;
  --bg-sidebar: #2c3e50;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-sidebar: #ecf0f1;
  --border-color: #e0e0e0;
  --hover-bg: #f8f9fa;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --modal-overlay: rgba(0,0,0,0.5);

  --status-not-started: #95a5a6;
  --status-in-progress: #3498db;
  --status-verifying: #e67e22;
  --status-completed: #27ae60;

  --priority-p0-plus-plus-plus: #c0392b;
  --priority-p0-plus-plus: #e74c3c;
  --priority-p0-plus: #e67e22;
  --priority-p0: #f39c12;
  --priority-p1: #3498db;
  --priority-p2: #1abc9c;
  --priority-empty: #bdc3c7;
}

[data-dark-mode="true"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-sidebar: #0f3460;
  --text-primary: #ecf0f1;
  --text-secondary: #95a5a6;
  --text-sidebar: #ecf0f1;
  --border-color: #34495e;
  --hover-bg: #1f4068;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --modal-overlay: rgba(0,0,0,0.7);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 18px;
  font-weight: bold;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 10px;
}

.nav-item {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s;
}

.nav-item:hover {
  background-color: rgba(255,255,255,0.1);
}

.nav-item.active {
  background-color: rgba(52, 152, 219, 0.3);
  border-left: 3px solid #3498db;
}

.nav-submenu {
  padding-left: 20px;
}

.nav-submenu-item {
  padding: 10px 20px 10px 35px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.nav-submenu-item:hover {
  background-color: rgba(255,255,255,0.05);
}

.nav-submenu-item.active {
  background-color: rgba(52, 152, 219, 0.2);
  border-left: 3px solid #3498db;
}

.team-badge {
  font-size: 11px;
  padding: 2px 6px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 4px;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Header */
.header {
  background-color: var(--bg-secondary);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.current-date {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: default;
  user-select: none;
}

.current-date:hover {
  opacity: 0.7;
}

.stats-container {
  display: flex;
  gap: 15px;
  align-items: center;
}

.stat-item {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.stat-item:hover {
  background-color: var(--hover-bg);
  border-color: var(--border-color);
}

.stat-item.active {
  background-color: #e8f4fd;
  border-color: #3498db;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
  transform: translateY(-1px);
}

.stat-not-started.active {
  background-color: #fff3e0;
  border-color: var(--status-not-started);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-in-progress.active {
  background-color: #e3f2fd;
  border-color: var(--status-in-progress);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-verifying.active {
  background-color: #f3e5f5;
  border-color: var(--status-verifying);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-completed.active {
  background-color: #e8f5e9;
  border-color: var(--status-completed);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 总数可点击，清除状态筛选 */



.stat-not-started {
  color: var(--status-not-started);
}

.stat-in-progress {
  color: var(--status-in-progress);
}

.stat-verifying {
  color: var(--status-verifying);
}

.stat-completed {
  color: var(--status-completed);
}

.stat-total {
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

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

.btn-primary {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

.btn-primary:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

.btn-icon {
  padding: 8px;
  font-size: 16px;
}

/* Todo List */
.todo-list {
  flex: 1;
  overflow-y: scroll;
  padding: 20px;
  min-height: 0;
}

/* 强制显示滚动条 - WebKit 浏览器 */
.todo-list::-webkit-scrollbar {
  width: 8px;
}
.todo-list::-webkit-scrollbar-track {
  background: var(--bg-primary, #f5f6fa);
  border-radius: 4px;
}
.todo-list::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.4);
  border-radius: 4px;
}
.todo-list::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.6);
}

.priority-group {
  margin-bottom: 25px;
}

.priority-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}

.todo-item {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}

.todo-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.todo-item.completed {
  opacity: 0.6;
}

.todo-item.completed .todo-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.todo-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo-checkbox.checked {
  background-color: var(--status-completed);
  border-color: var(--status-completed);
}

.todo-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
}

.todo-content {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.todo-deadline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.todo-deadline.overdue {
  color: #e74c3c;
  font-weight: 600;
}

.todo-deadline.urgent {
  color: #e67e22;
  font-weight: 600;
}

.todo-tags {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.tag-priority {
  color: white;
}

.tag-priority.p0-plus-plus-plus {
  background-color: var(--priority-p0-plus-plus-plus);
}

.tag-priority.p0-plus-plus {
  background-color: var(--priority-p0-plus-plus);
}

.tag-priority.p0-plus {
  background-color: var(--priority-p0-plus);
}

.tag-priority.p0 {
  background-color: var(--priority-p0);
}

.tag-priority.p1 {
  background-color: var(--priority-p1);
}

.tag-priority.p2 {
  background-color: var(--priority-p2);
}

.tag-priority.empty {
  background-color: var(--priority-empty);
}

.tag-status {
  color: white;
}

.tag-status.not-started {
  background-color: var(--status-not-started);
}

.tag-status.in-progress {
  background-color: var(--status-in-progress);
}

.tag-status.verifying {
  background-color: var(--status-verifying);
}

.tag-status.completed {
  background-color: var(--status-completed);
}

.owner-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background-color: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.assignee-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.assignee-checkbox-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}
[data-dark-mode="true"] .assignee-checkbox-item {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
}
[data-dark-mode="false"] .assignee-checkbox-item {
  border: 1px solid #e0e0e0;
  background: #f5f6fa;
}
.assignee-checkbox-item:hover {
  background: rgba(255,255,255,0.1);
}
.assignee-checkbox-item.selected {
  background: rgba(99,102,241,0.2);
  border-color: rgba(99,102,241,0.5);
}
.assignee-checkbox-item input[type="checkbox"] {
  display: none;
}

.todo-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.action-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-btn:hover {
  background-color: var(--hover-bg);
  border-color: #bdc3c7;
}

.action-btn.advance {
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

.action-btn.advance:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.action-btn.history {
  color: #e67e22;
  border-color: rgba(230, 126, 34, 0.3);
}

.action-btn.history:hover {
  background-color: rgba(230, 126, 34, 0.1);
}

.action-btn.edit {
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

.action-btn.edit:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.action-btn.delete {
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.3);
}

.action-btn.delete:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

.todo-notes {
  margin-top: 8px;
  padding: 8px;
  background-color: var(--hover-bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Floating Home Button */
.home-float-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  text-decoration: none;
  z-index: 9999;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.home-float-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

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

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
  margin-bottom: 8px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.25s ease-out;
}

[data-dark-mode="true"] .modal {
  background-color: #1e293b;
  color: #e2e8f0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input:focus {
  outline: none;
  border-color: #3498db;
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Confirm Dialog */
.confirm-dialog {
  width: 90%;
  max-width: 400px;
}

.confirm-message {
  padding: 20px 0;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
}

/* 详情弹窗 */
.detail-modal-content {
  max-width: 500px;
}

.detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.detail-body {
  padding: 20px 0 0;
}

.detail-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.detail-label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 80px;
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.detail-section {
  padding: 16px 0 0;
}

.detail-section .detail-label {
  display: block;
  margin-bottom: 10px;
}

.detail-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--hover-bg);
  border-radius: 8px;
  font-size: 13px;
}

.detail-history-item .history-status {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.detail-history-item .history-date {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Status History Modal */
.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.history-status {
  flex-shrink: 0;
}

.history-time {
  flex: 1;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Mobile Responsive */
.mobile-menu-btn {
  display: none;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}

/* 抽屉遮罩 + 关闭按钮(只在移动端用) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}
.sidebar-overlay.show { display: block; }
.sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-sidebar);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  z-index: 1;
  align-items: center;
  justify-content: center;
}
.sidebar-close:hover { background: rgba(255, 255, 255, 0.12); }

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-close { display: flex; }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: left 0.3s ease;
    width: 280px;
  }

  .sidebar.open {
    left: 0;
  }

  .header-left {
    gap: 8px;
    flex-wrap: wrap;
  }

  .current-date {
    font-size: 14px;
  }

  .stats-container {
    gap: 6px;
    flex-wrap: wrap;
  }

  .stat-item {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 12px;
  }

  .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .btn span {
    display: none;
  }

  .btn-icon {
    padding: 6px;
    font-size: 14px;
    width: 32px;
    height: 32px;
  }

  .todo-list {
    padding: 16px 12px;
  }

  .todo-item {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 12px;
  }

  .todo-content {
    min-width: 0;
    flex: 1;
    order: 2;
    margin-top: 8px;
  }

  .todo-checkbox {
    order: 1;
  }

  .todo-actions {
    order: 3;
    margin-left: 0;
    gap: 8px;
  }

  .action-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    margin: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
  }

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

  .form-group {
    margin-bottom: 16px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

[data-dark-mode="true"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
}

[data-dark-mode="true"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* 返回首页按钮 */
.home-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  color: var(--status-in-progress);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}
.home-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}
