.triggerGroup {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 30px;
  border-radius: var(--radius-md);
  color: rgb(var(--fg-color));
  transition: background 0.12s;
  position: relative;
}

.pinTrigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: rgba(var(--fg-dim), 0.9);
  transition: all 0.12s;
}
.pinTrigger:hover:not(:disabled) {
  background: rgba(var(--border), 0.1);
  color: rgb(var(--fg-color));
}
.pinTriggerOn {
  color: rgb(var(--accent));
  background: rgba(var(--accent), 0.2);
}
.pinTrigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.trigger:hover {
  background: rgba(var(--border), 0.08);
}
.triggerActive {
  background: rgba(var(--accent), 0.18);
  color: rgb(var(--accent));
}
.trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.trigger:disabled:hover {
  background: transparent;
}

.badge {
  background: rgba(var(--accent), 0.25);
  color: rgb(var(--accent));
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  /* 固定高度：避免 active/done tab 切换时列表长度变化引发窗口尺寸抖动 */
  height: 320px;
}

/* ============ Tabs ============ */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 6px;
  position: relative;
  border-bottom: 1px solid rgba(var(--border), 0.06);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: rgba(var(--fg-dim), 0.95);
  font-size: 13px;
  background: transparent;
  position: relative;
  z-index: 1;
  transition: color 0.18s ease;
}
.tab:hover {
  color: rgb(var(--fg-color));
}
.tab:active {
  transform: scale(0.96);
  transition: transform 0.08s ease, color 0.18s ease;
}
.tabActive {
  color: rgb(var(--accent));
  font-weight: 600;
}

/* 底部滑块指示器：跟随激活 tab 平滑滑动 */
.tabIndicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgb(var(--accent));
  border-radius: 2px;
  transition: transform 0.28s cubic-bezier(0.4, 0.0, 0.2, 1),
    width 0.28s cubic-bezier(0.4, 0.0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(var(--accent), 0.4);
}
.tabCount {
  background: rgba(var(--border), 0.12);
  color: rgba(var(--fg-color), 0.9);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 14px;
  transition: background 0.18s ease, color 0.18s ease;
}
.tabActive .tabCount {
  background: rgba(var(--accent), 0.3);
  color: rgb(var(--accent));
}
/* 未激活的「已完成」用黄色脉冲气泡提醒待清理；激活后回归 accent 配色，
   避免颜色被静态徽章吃掉，导致切换"看不出动效" */
.tabCountAlert {
  background: rgba(var(--warning), 0.25);
  color: rgb(var(--warning));
  animation: bubble 1.6s ease-in-out infinite;
}
.tabActive .tabCountAlert {
  background: rgba(var(--accent), 0.3);
  color: rgb(var(--accent));
  animation: none;
}
@keyframes bubble {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.clearBtn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(var(--danger), 0.12);
  color: rgb(var(--danger));
  font-size: 12px;
  transition: all 0.12s;
}
.clearBtn:hover {
  background: rgba(var(--danger), 0.22);
}

/* ============ Input ============ */
.inputRow {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.inputRow input {
  flex: 1;
  height: 36px;
  min-width: 0;
  padding: 6px 14px;
  font-size: 14px;
}
.addBtn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(var(--accent), 0.18);
  color: rgb(var(--accent));
  flex-shrink: 0;
}
.addBtn:hover {
  background: rgba(var(--accent), 0.28);
}

/* ============ List ============ */
.list {
  flex: 1;
  min-height: 0; /* flex 子项允许收缩，配合 overflow-y 滚动 */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.empty {
  text-align: center;
  color: rgba(var(--fg-dim), 0.7);
  font-size: 13px;
  padding: 24px 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.row:hover {
  background: rgba(var(--border), 0.04);
}
.rowDone .title2 {
  color: rgba(var(--fg-dim), 0.55);
  text-decoration: line-through;
}

.grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(var(--fg-dim), 0.5);
  opacity: 0;
  cursor: grab;
  width: 18px;
  height: 22px;
}
.row:hover .grip {
  opacity: 1;
}
.grip:active {
  cursor: grabbing;
}

.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}
.check input {
  opacity: 0;
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.check span {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(var(--border), 0.3);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all 0.15s;
}
.check input:checked + span {
  background: rgb(var(--accent));
  border-color: rgb(var(--accent));
}
.check input:checked + span::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.title2 {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  cursor: text;
  user-select: text;
  color: rgb(var(--fg-color));
}

.editInput {
  flex: 1;
  height: 28px;
  font-size: 14px;
  padding: 2px 8px;
}

.actions {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}
.row:hover .actions {
  opacity: 1;
}

.iconBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: rgba(var(--fg-dim), 0.9);
  transition: all 0.12s;
}
.iconBtn:hover {
  background: rgba(var(--border), 0.1);
  color: rgb(var(--fg-color));
}
.danger:hover {
  background: rgba(var(--danger), 0.18);
  color: rgb(var(--danger));
}
