/* 待办事项桌面图标 */
.todo-icon .icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><rect x="4" y="4" width="40" height="40" rx="3" fill="%23e8f5e9" stroke="%234caf50" stroke-width="2"/><path d="M12 24l4 4 8-8" stroke="%234caf50" stroke-width="3" fill="none" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 14h24M12 34h24" stroke="%234caf50" stroke-width="2" fill="none"/></svg>');
}

/* 待办事项窗口样式 */
.window.todo-window {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
  height: 600px;
  flex-direction: column;
  background: #ece9d8;
  border: 2px solid;
  border-color: #dfce56 #828282 #828282 #dfce56;
  box-shadow: inset 1px 1px 0 0 #ffffff, inset -1px -1px 0 0 #000000;
  z-index: 9998;
}

.todo-window.minimized {
  display: none !important;
}

.window.todo-window.maximized {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: calc(100% - 40px) !important;
  transform: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.todo-window .window-titlebar {
  background: linear-gradient(to right, #000080, #1084d7);
  color: white;
  padding: 2px 2px 2px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  font-weight: bold;
  font-size: 11px;
  flex-shrink: 0;
}

.todo-window .window-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.todo-window .window-title::before {
  content: "✓";
  font-weight: bold;
  font-size: 16px;
}

.todo-window .window-controls button {
  width: 16px;
  height: 14px;
  margin: 0 1px;
  padding: 0;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfce56 #828282 #828282 #dfce56;
  color: black;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.todo-window .window-controls button:active {
  border-color: #828282 #dfce56 #dfce56 #828282;
}

.todo-window .window-controls button:hover {
  background: #dfce56;
}

/* 待办事项窗口内容区域 */
.todo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ece9d8;
}

/* 工具栏 */
.todo-toolbar {
  padding: 4px;
  background: #c0c0c0;
  border-bottom: 1px solid #dfce56;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.todo-toolbar input,
.todo-toolbar button {
  padding: 2px 4px;
  border: 1px solid;
  border-color: #dfce56 #828282 #828282 #dfce56;
  background: #c0c0c0;
  color: black;
  font-size: 11px;
  cursor: pointer;
  font-family: "MS Sans Serif", Arial, sans-serif;
}

.todo-toolbar input {
  flex: 1;
  min-width: 150px;
  border: 1px inset #dfce56;
  padding: 2px 4px;
  background: white;
  color: black;
}

.todo-toolbar input:focus {
  outline: none;
  background: white;
}

.todo-toolbar button {
  white-space: nowrap;
  padding: 2px 6px;
}

.todo-toolbar button:active {
  border-color: #828282 #dfce56 #dfce56 #828282;
}

.todo-toolbar button:hover {
  background: #dfce56;
}

/* 统计信息 */
#todo-stats {
  padding: 4px 8px;
  background: #e0e0e0;
  border-bottom: 1px solid #dfce56;
  font-size: 11px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.stat-item {
  white-space: nowrap;
}

/* 筛选按钮组 */
.todo-filters {
  padding: 4px;
  background: #c0c0c0;
  border-bottom: 1px solid #dfce56;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.todo-filter-btn {
  padding: 2px 8px;
  border: 1px solid;
  border-color: #dfce56 #828282 #828282 #dfce56;
  background: #c0c0c0;
  color: black;
  font-size: 11px;
  cursor: pointer;
  font-family: "MS Sans Serif", Arial, sans-serif;
  white-space: nowrap;
}

.todo-filter-btn:active {
  border-color: #828282 #dfce56 #dfce56 #828282;
}

.todo-filter-btn.active {
  background: #dfce56;
  border-color: #828282 #dfce56 #dfce56 #828282;
  font-weight: bold;
}

/* 待办列表 */
#todo-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px;
  background: white;
  border: 1px inset #dfce56;
}

#todo-list::-webkit-scrollbar {
  width: 16px;
}

#todo-list::-webkit-scrollbar-track {
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfce56 #828282 #828282 #dfce56;
}

#todo-list::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfce56 #828282 #828282 #dfce56;
}

#todo-list::-webkit-scrollbar-thumb:hover {
  background: #dfce56;
}

/* 待办空状态 */
.todo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  font-style: italic;
  font-size: 12px;
}

/* 待办项目 */
.todo-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  margin: 2px 0;
  background: white;
  border: 1px solid #c0c0c0;
  border-radius: 2px;
  font-size: 11px;
  cursor: default;
  transition: all 0.2s ease;
}

.todo-item:hover {
  background: #e8f4fd;
  border-color: #0078d7;
}

.todo-item.completed {
  opacity: 0.6;
  background: #f0f0f0;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #888;
}

/* 优先级样式 */
.todo-item.priority-high {
  border-left: 3px solid #ef4444;
}

.todo-item.priority-normal {
  border-left: 3px solid #f59e0b;
}

.todo-item.priority-low {
  border-left: 3px solid #10b981;
}

/* 复选框 */
.todo-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
  accent-color: #0078d7;
  flex-shrink: 0;
}

/* 任务文本 */
.todo-text {
  flex: 1;
  word-break: break-all;
  cursor: pointer;
  user-select: none;
  padding: 2px 4px;
  border-radius: 2px;
}

.todo-text:hover {
  background: rgba(0, 120, 215, 0.1);
}

/* 编辑输入框 */
.todo-edit-input {
  flex: 1;
  padding: 2px 4px;
  border: 1px solid #0078d7;
  border-radius: 2px;
  font-size: 11px;
  font-family: "MS Sans Serif", Arial, sans-serif;
}

.todo-edit-input:focus {
  outline: none;
  background: #e8f4fd;
  border-color: #0078d7;
}

/* 优先级按钮 */
.priority-btn {
  width: 20px;
  height: 16px;
  padding: 0;
  border: 1px solid #c0c0c0;
  background: #e0e0e0;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.priority-btn:hover {
  background: #f0f0f0;
  border-color: #0078d7;
}

.priority-btn:active {
  background: #dfce56;
}

/* 删除按钮 */
.delete-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid #c0c0c0;
  background: #e0e0e0;
  color: #ef4444;
  cursor: pointer;
  font-size: 11px;
  border-radius: 2px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-btn:hover {
  border-color: #ef4444;
  color: white;
  background: #ef4444;
}

.delete-btn:active {
  border-color: #828282 #dfce56 #dfce56 #828282;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .window.todo-window {
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    transform: none !important;
  }

  .todo-window.minimized {
    display: none !important;
  }

  /* 优化工具栏在小屏幕上的显示 */
  .todo-toolbar {
    flex-direction: column;
    gap: 6px;
  }

  .todo-toolbar input {
    width: 100%;
    min-width: unset;
  }

  .todo-toolbar button {
    width: 100%;
  }

  /* 统计信息单行显示 */
  #todo-stats {
    flex-direction: row;
    gap: 8px;
    font-size: 12px;
  }

  .stat-item {
    flex: 1;
    text-align: center;
  }

  /* 筛选按钮自适应 */
  .todo-filters {
    flex-wrap: wrap;
    gap: 6px;
  }

  .todo-filter-btn {
    flex: 1;
    min-width: calc(33.333% - 4px);
  }

  /* 待办项目在小屏幕上的显示 */
  .todo-item {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    margin: 4px 0;
  }

  /* 复选框和文本占一行 */
  .todo-item > .todo-checkbox {
    order: 1;
    width: 18px;
    height: 18px;
  }

  .todo-item > .todo-text,
  .todo-item > .todo-edit-input {
    order: 2;
    flex: 1;
    min-width: 0;
    margin-left: 4px;
  }

  /* 操作按钮放在下一行 */
  .todo-item > .priority-btn,
  .todo-item > .delete-btn {
    order: 3;
  }

  /* 优先级按钮变大 */
  .priority-btn {
    width: 28px;
    height: 24px;
    font-size: 14px;
  }

  /* 删除按钮变大 */
  .delete-btn {
    width: 28px;
    height: 24px;
    font-size: 14px;
  }

  /* 编辑输入框 */
  .todo-edit-input {
    font-size: 13px;
    padding: 4px 6px;
  }

  /* 任务文本 */
  .todo-text {
    font-size: 13px;
    padding: 4px 6px;
  }

  /* 列表容器 */
  #todo-list {
    padding: 6px;
  }

  /* 标题栏高度保持 */
  .todo-window .window-titlebar {
    padding: 4px;
  }

  .todo-window .window-title {
    font-size: 13px;
  }

  /* 控制按钮变大 */
  .todo-window .window-controls button {
    width: 20px;
    height: 18px;
    font-size: 12px;
  }

  /* 横屏时更紧凑 */
  @media (orientation: landscape) {
    .todo-toolbar {
      flex-direction: row;
      flex-wrap: wrap;
    }

    .todo-toolbar input {
      flex: 1;
      min-width: 150px;
    }

    .todo-item {
      flex-wrap: nowrap;
      gap: 6px;
    }

    .priority-btn,
    .delete-btn {
      width: 20px;
      height: 16px;
      font-size: 12px;
    }
  }

  /* 纵屏时优化 */
  @media (orientation: portrait) {
    .todo-toolbar {
      flex-direction: column;
    }

    .todo-toolbar input {
      width: 100%;
    }

    .todo-toolbar button {
      width: 100%;
    }

    .todo-filters {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}

/* ========== 通知容器样式 ========== */
#notification-container {
  position: fixed;
  top: 60px;
  right: 20px;
  max-width: 360px;
  z-index: 10000;
  pointer-events: none;
}

/* 单个通知 */
.notification {
  pointer-events: all;
  margin-bottom: 12px;
  animation: notificationSlideIn 0.3s ease-out;
}

.notification-hide {
  animation: notificationSlideOut 0.3s ease-in;
  opacity: 0;
}

@keyframes notificationSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes notificationSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* 通知内容 */
.notification-content {
  background: white;
  border: 2px solid;
  border-color: #dfce56 #828282 #828282 #dfce56;
  box-shadow: inset 1px 1px 0 0 #ffffff, inset -1px -1px 0 0 #000000,
              0 2px 8px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  overflow: hidden;
  font-family: "MS Shell Dlg", Arial, sans-serif;
  font-size: 11px;
  color: #000;
}

/* 优先级相关样式 */
.notification-content.priority-high {
  border-left: 4px solid #e74c3c;
}

.notification-content.priority-medium {
  border-left: 4px solid #f39c12;
}

.notification-content.priority-low {
  border-left: 4px solid #27ae60;
}

/* 通知头部 */
.notification-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(to right, #000080, #1084d7);
  color: white;
  padding: 4px 8px;
  font-weight: bold;
  font-size: 12px;
}

.notification-priority {
  font-size: 14px;
  line-height: 1;
}

.notification-title {
  flex: 1;
}

.notification-close {
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfce56 #808080 #808080 #dfce56;
  color: #000;
  width: 16px;
  height: 14px;
  padding: 0;
  font-size: 11px;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:active {
  border-color: #808080 #dfce56 #dfce56 #808080;
}

/* 通知文本内容 */
.notification-text {
  padding: 8px;
  max-height: 60px;
  overflow-y: auto;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  background: #f0f0f0;
  border-bottom: 1px solid #c0c0c0;
}

/* 通知时间 */
.notification-time {
  padding: 4px 8px;
  font-size: 10px;
  color: #666;
  background: #e0e0e0;
  border-bottom: 1px solid #c0c0c0;
  text-align: right;
}

/* 通知操作按钮 */
.notification-actions {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #c0c0c0;
}

.notification-actions button {
  flex: 1;
  padding: 2px 6px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfce56 #808080 #808080 #dfce56;
  color: #000;
  font-size: 11px;
  cursor: pointer;
  font-family: "MS Shell Dlg", Arial, sans-serif;
}

.notification-actions button:active {
  border-color: #808080 #dfce56 #dfce56 #808080;
}

.notification-actions button:hover {
  background: #d0d0d0;
}

.notification-complete {
  min-width: 50px;
}

.notification-view {
  min-width: 50px;
}

/* 移动端通知样式调整 */
@media (max-width: 600px) {
  #notification-container {
    top: 50px;
    right: 8px;
    left: 8px;
    max-width: none;
    width: calc(100% - 16px);
  }

  .notification {
    margin-bottom: 8px;
  }

  .notification-content {
    font-size: 12px;
  }

  .notification-header {
    font-size: 11px;
    padding: 3px 6px;
    gap: 4px;
  }

  .notification-text {
    padding: 6px;
    font-size: 12px;
    max-height: 80px;
  }

  .notification-time {
    padding: 3px 6px;
    font-size: 10px;
  }

  .notification-actions {
    padding: 4px 6px;
    gap: 3px;
  }

  .notification-actions button {
    padding: 3px 4px;
    font-size: 10px;
  }
}
