/* ============================================================
   待办页
   ============================================================ */
[data-page="todo"] { display: flex; flex-direction: column; overflow: hidden; }

/* ── 待办日期导航（单独一行） ── */
.todo-date-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 6px;
  background: transparent;
}
.todo-date-label {
  font-size: 14px;
  font-weight: 680;
  color: var(--text);
  letter-spacing: -.01em;
  flex: 1;
  text-align: center;
}
.todo-date-arrow {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text3);
  flex-shrink: 0;
  transition: color var(--tr), background var(--tr);
}
.todo-date-arrow:active { background: var(--material-field); color: var(--text); }
.todo-date-arrow:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.todo-date-arrow svg { width: 16px; height: 16px; }

/* ── 待办 Tab（原样） ── */
.todo-tabs {
  flex-shrink: 0;
  display: flex;
  padding: 0 18px;
  gap: 4px;
  background: transparent;
  position: relative;
}
.todo-tab-row { display: flex; gap: 0; }
.todo-tab {
  flex: 1;
  padding: 9px 4px 8px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--text3);
  text-align: center;
  transition: color var(--tr-fast) var(--ease-standard);
  position: relative;
  z-index: 1;
}
.todo-tab:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.todo-tab.active { color: var(--accent); font-weight: 700; }
.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--accent);
  /* Width eases in CSS; horizontal position uses Motion spring in todo.js */
  transition: width 0.26s var(--ease-nav);
  will-change: transform;
}
.tab-count { font-size: inherit; font-weight: inherit; margin-left: 4px; opacity: .7; }

.tab-panel { display: none; min-height: 100%; padding: 15px 18px calc(var(--nav-h) + var(--safe-bottom) + 34px); }
.tab-panel.active { display: block; }

/* 任务列表 */
.task-list { display: flex; flex-direction: column; gap: 12px; overflow-anchor: none; }

.task-item {
  --priority-color: var(--accent);
  --priority-alpha: .5;
  --task-action-width: 216px;
  background: var(--material-raised);
  border: 1px solid var(--separator-soft);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--tr-fast) var(--ease-standard), box-shadow var(--tr-fast) var(--ease-standard), border-color var(--tr-fast) var(--ease-standard);
  touch-action: none;
}
.task-item.type-2,
.task-item.type-3 {
  box-shadow: var(--shadow-card);
}
.task-item:active { transform: scale(.988); box-shadow: 0 1px 0 rgba(255,255,255,0.45) inset; }
.task-item::before {
  display: none;
}
.task-item.done { opacity: .72; }
.task-item:active { transform: scale(.988); }

.task-item.done {
  --task-action-width: 72px;
}
.task-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  width: 100%;
  transition: transform var(--duration-slide) var(--ease-slide);
}
.task-item.swipe-open .task-content {
  transform: translateX(calc(-1 * var(--task-action-width)));
}
.task-swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: var(--task-action-width);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  transform: translateX(104%);
  transition: transform var(--duration-slide) var(--ease-slide);
  overflow: hidden;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.task-swipe-actions.done-actions {
  grid-template-columns: 1fr;
}
.task-item.swipe-open .task-swipe-actions {
  transform: translateX(0);
}
.task-swipe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: -.01em;
}
.task-swipe-btn:active {
  opacity: .86;
}
.task-swipe-done {
  background: color-mix(in srgb, var(--accent) 86%, #fff 14%);
}
.task-swipe-delete {
  background: color-mix(in srgb, var(--accent) 76%, #111 24%);
}
.task-swipe-reschedule {
  background: color-mix(in srgb, var(--accent) 58%, #2f3448 42%);
}

body.priority-dragging { overscroll-behavior: contain; }
.priority-dragging .task-item { transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease; }
.task-item.dragging {
  opacity: .34;
  transform: scale(.985);
  box-shadow: none;
}
.task-drag-placeholder {
  list-style: none;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, transparent);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent-light) 46%, transparent),
      color-mix(in srgb, var(--material-raised) 72%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-light) 42%, transparent);
  pointer-events: none;
  min-height: 48px;
  transition: transform .12s ease, opacity .12s ease, height .12s ease;
}
.task-drag-ghost {
  position: fixed;
  z-index: 60;
  margin: 0;
  list-style: none;
  pointer-events: none;
  opacity: .96;
  transform: scale(1.02);
  box-shadow: 0 18px 42px rgba(8,9,16,.28);
  touch-action: none;
  will-change: left, top;
}

.task-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; letter-spacing: -.02em; color: var(--text); }
.task-item.done .task-title { text-decoration: line-through; color: var(--text3); font-weight: 650; }
.task-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.task-time-tag { font-size: 11px; font-weight: 560; color: var(--text3); display: flex; align-items: center; gap: 3px; }
.task-time-tag svg { width: 10px; height: 10px; }
.task-time-tag.overdue { color: var(--danger); }
.task-type-tag { font-size: 10px; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--accent-light) 48%, transparent); color: color-mix(in srgb, var(--accent) 78%, var(--text2) 22%); font-weight: 650; letter-spacing: .02em; }
.task-note { font-size: 11px; font-weight: 500; color: var(--text3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }

/* 拖拽 */
.task-item[draggable="true"] { cursor: grab; }
.task-item.drag-over-top { border-top: 2px solid var(--accent) !important; }
.task-item.drag-over-bottom { border-bottom: 2px solid var(--accent) !important; }


/* ── 日期导航标签按钮 & 回今天点 ── */
.todo-date-label-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.todo-date-label-btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
.today-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .8;
}
