#sidebar { flex: 0 0 176px; display: flex; flex-direction: column; padding: 12px 8px; border-right: 1px solid var(--line); min-height: 0; }
#detail { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; padding: 12px; min-height: 0; }
#searchInput { width: 100%; margin-bottom: 8px; }
.list-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.list-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.list-item:hover { background: rgba(0, 0, 0, 0.05); }
.list-item.active { background: var(--accent-soft); font-weight: 600; }
.list-item .ldot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.list-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .cnt { color: var(--muted); font-size: 12px; }
.list-item .ops { display: none; gap: 2px; }
.list-item:hover .ops { display: flex; }
.list-item .ops button { border: 0; background: transparent; padding: 0 3px; font-size: 12px; }
.list-item input { flex: 1; width: 100%; padding: 2px 6px; }
.trash-item { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.add-list { color: var(--muted); }
.side-foot { margin-top: 6px; }
.side-foot button { width: 100%; font-size: 12px; color: var(--muted); }
.side-foot .io-row { display: flex; gap: 6px; }
.side-foot .io-row button { flex: 1; width: auto; }
.side-foot .io-state { margin-bottom: 4px; font-size: 12px; color: var(--muted); }

.d-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; }
.d-head h2 { margin: 0; font-size: 17px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-head .ldot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.sort-menu { position: absolute; right: 0; top: 34px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); padding: 4px; min-width: 150px; }
.sort-menu div { padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.sort-menu div:hover { background: var(--accent-soft); }
.sort-menu .cur { color: var(--accent); font-weight: 600; }
.d-body { flex: 1; overflow-y: auto; min-height: 0; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }

.task { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-card); cursor: pointer; border: 1px solid transparent; }
.task:hover { background: rgba(0, 0, 0, 0.04); }
.task .main { flex: 1; min-width: 0; }
.task .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .meta { color: var(--muted); font-size: 12px; }
.task .badge { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 6px; }
.task.done .title { color: var(--done); }
.task.done .meta { color: var(--done); }
.group-head { margin: 12px 0 4px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }

/* 左滑露出右侧操作：内容层不平移，而是让出右侧一块宽度（文字缩短成省略号，不会被裁掉）。
   --p 是展开进度 0→1：让出的宽度、按钮的淡入与缩放都由它推算，拖动时一起跟手，松手后一起缓动吸附。 */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
.swipe { --swipe-w: 52px; --p: 0; position: relative; flex: none; overflow: hidden; border-radius: var(--radius-card); touch-action: pan-y; }
.swipe:not(.dragging) { transition: --p 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.swipe.dragging { user-select: none; }
.swipe-main { position: relative; z-index: 1; margin-right: calc(var(--p) * var(--swipe-w)); }
.swipe-actions {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--swipe-w);
  display: flex; align-items: center; justify-content: center;
  opacity: var(--p); transform: translateX(calc((1 - var(--p)) * 14px)) scale(calc(0.7 + 0.3 * var(--p)));
}
/* 操作按钮：浅红底胶囊，悬停才变实心红 */
.swipe .swipe-actions > button,
button.icon-trash {
  flex: none; height: 32px; padding: 0; border: 0; border-radius: 16px; font-size: 13px;
  background: rgba(229, 72, 77, 0.12); color: var(--danger);
}
.swipe .swipe-actions > button:hover:not(:disabled),
button.icon-trash:hover:not(:disabled) { background: var(--danger); color: #fff; }
/* 默认「删除」：圆形垃圾桶图标（按钮文字保留给提示与读屏，不显示） */
.swipe:not(.trash-swipe) .swipe-actions > button,
button.icon-trash { position: relative; width: 32px; font-size: 0; }
.swipe:not(.trash-swipe) .swipe-actions > button::before,
button.icon-trash::before {
  content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--icon-trash) center / contain no-repeat; mask: var(--icon-trash) center / contain no-repeat;
}
/* 垃圾桶图标放 :root：左滑删除与详情页删除（.icon-trash）共用 */
:root { --icon-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M6 6l1 14h10l1-14'/%3E%3Cpath d='M10 11v5M14 11v5'/%3E%3C/svg%3E"); }
/* 回收站里的「永久删除」：文字胶囊，操作区更宽 */
.trash-swipe { --swipe-w: 92px; border-radius: 0; border-bottom: 1px solid var(--line); }
.trash-swipe .swipe-actions > button { padding: 0 12px; }

.form label { display: block; margin: 10px 0 3px; color: var(--muted); font-size: 12px; }
.form input[type='text'], .form select, .form input[type='datetime-local'] { width: 100%; }
.form .comp { display: flex; gap: 6px; margin-bottom: 6px; }
.form .actions { display: flex; gap: 8px; margin-top: 16px; }
.form .hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
.trash-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.trash-row .trash-main { flex: 1; min-width: 0; }
.trash-row .meta { color: var(--muted); font-size: 12px; }
.trash-row .btns { flex: none; display: flex; gap: 6px; }
.from-list { color: var(--accent); font-size: 12px; margin-left: 4px; }

/* 左栏变窄时压缩清单栏与内边距，保证任务列表可用 */
@container (max-width: 460px) {
  #sidebar { flex: 0 0 132px; padding: 10px 6px; }
  #detail { padding: 10px 8px; }
  .d-head { gap: 6px; margin-bottom: 8px; }
  .d-head h2 { font-size: 15px; }
  .d-head > button { padding: 2px 6px; font-size: 12px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .list-item { padding: 5px 6px; }
  .task { padding: 7px 8px; gap: 6px; }
  .task > button { padding: 3px 8px; font-size: 12px; }
}
@container (max-width: 330px) {
  #sidebar { flex: 0 0 112px; }
  #detail { padding: 8px 6px; }
  .list-item .cnt { display: none; }
  .task .title { font-size: 13px; }
}
@container (max-width: 280px) {
  #sidebar { display: none; }
}
