/* =====================================================================
 * 待办清单模块样式（assets/css/widgets/todo.css）
 * 依赖 base.css 的主题变量，不引入新变量
 * ===================================================================== */

.todo-panel {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 10px;
  box-shadow: var(--shadow);
}

/* ---------- 头部 ---------- */
.todo-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.todo-head-main { display: flex; align-items: center; gap: 8px; }
.todo-head-main .t-icon { font-size: 17px; }
.todo-title { font-size: 15px; font-weight: 700; }
.todo-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.todo-count { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- 输入区 ---------- */
.todo-compose {
  display: flex; align-items: flex-end; gap: 8px;
}
.todo-input {
  flex: 1; min-width: 0;
  font-family: inherit; font-size: 15px; line-height: 22px;
  color: var(--text); background: var(--bg-subtle);
  border: 1px solid transparent; border-radius: 10px;
  padding: 8px 12px; resize: none; overflow: hidden;
  height: 40px; min-height: 40px; max-height: 132px;
  box-sizing: border-box;
}
.todo-input::placeholder { color: var(--text-3); }
.todo-input:focus {
  outline: none; border-color: var(--accent);
  background: var(--bg-card);
}

.todo-add {
  flex: none; border: none; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  height: 40px; padding: 0 18px;
  background: var(--accent); color: #fff;
}
.todo-add:active { opacity: 0.85; }

/* 日期按钮 + 隐藏的原生日期选择器 */
.todo-date-btn {
  flex: none; height: 40px; min-width: 40px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-subtle); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.todo-date-btn:hover { border-color: var(--accent); color: var(--accent); }
.todo-date-btn.has-date {
  background: var(--accent-soft); color: var(--accent);
  border-color: transparent;
}
#todo-date-label { line-height: 1; }
.todo-date-native {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  border: 0; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- 提示行 ---------- */
.todo-hint {
  font-size: 12px; line-height: 1.5; color: var(--text-3);
  margin: 8px 0 0; padding: 0 2px;
}
.todo-hint:empty { display: none; }
.todo-hint.is-warn { color: var(--yellow); }
.todo-hint.is-live { color: var(--accent); }

/* ---------- 导入录音 ---------- */
.todo-tool {
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-2); font-family: inherit; font-size: 12px;
  padding: 4px 10px; border-radius: 8px; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
  height: 28px;
}
.todo-tool:hover { border-color: var(--accent); color: var(--accent); }
.todo-tool:disabled { opacity: 0.55; cursor: default; }
.todo-tool.is-busy { color: var(--accent); border-color: var(--accent); }
.todo-tool-icon { font-size: 13px; line-height: 1; }

@media (max-width: 420px) {
  .todo-tool { padding: 4px 8px; font-size: 11.5px; }
  .todo-count { display: none; }
}

/* ---------- 列表 ---------- */
.todo-list { list-style: none; margin: 6px 0 0; }
.todo-group {
  font-size: 12px; color: var(--text-3); font-weight: 600;
  padding: 14px 2px 6px; letter-spacing: 0.02em;
}

.todo-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 2px; border-bottom: 1px dashed var(--border);
}
.todo-item:last-child { border-bottom: none; }

.todo-check { flex: none; padding-top: 2px; }
.todo-check input {
  width: 19px; height: 19px; margin: 0;
  accent-color: var(--accent); cursor: pointer;
}

.todo-text {
  flex: 1; min-width: 0; font-size: 15px; line-height: 1.5;
  word-break: break-word; cursor: text;
}
.todo-item.is-done .todo-text {
  color: var(--text-3); text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.todo-act {
  flex: none; width: 28px; height: 26px; padding: 0;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 14px; line-height: 1;
  border-radius: 6px;
}
.todo-act:hover { background: var(--bg-subtle); color: var(--accent); }
.todo-act-del:hover { color: var(--red); }

/* 截止日期徽标 */
.todo-due {
  flex: none; align-self: center;
  border: none; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: 999px;
  background: var(--bg-subtle); color: var(--text-2);
  white-space: nowrap;
}
.todo-due:hover { background: var(--accent-soft); color: var(--accent); }
.todo-due.is-today { background: var(--accent-soft); color: var(--accent); }
.todo-due.is-overdue { background: var(--red-bg); color: var(--red); }
.todo-item.is-done .todo-due { opacity: 0.6; }

@media (max-width: 420px) {
  .todo-act { width: 24px; font-size: 13px; }
  .todo-item { gap: 6px; }
  .todo-add { padding: 0 14px; }
}

.todo-edit {
  flex: 1; min-width: 0;
  font-family: inherit; font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg-card);
  border: none; border-bottom: 2px solid var(--accent);
  border-radius: 0; padding: 0 0 2px;
  outline: none;
}

.todo-empty {
  padding: 28px 8px 20px; text-align: center;
  font-size: 14px; color: var(--text-3);
}

/* ---------- 底部操作 ---------- */
.todo-foot { padding: 6px 0 8px; text-align: right; }
.todo-clear {
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--text-3);
  padding: 6px 8px; border-radius: 8px;
}
.todo-clear:hover { color: var(--red); background: var(--red-bg); }

/* ---------- 撤销提示 ---------- */
.todo-toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 24px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  background: #1f2937; color: #f9fafb;
  font-size: 13px; padding: 10px 14px; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
  max-width: calc(100vw - 32px);
}
.todo-toast[hidden] { display: none; }
.todo-toast button {
  border: none; background: transparent; cursor: pointer;
  color: #93c5fd; font-family: inherit; font-size: 13px;
  font-weight: 600; padding: 2px 4px;
}
@media (max-width: 860px) {
  .todo-toast { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
