/**
 * 待办清单组件样式
 *   - 桌面卡片 2×2 / 4×2 共用：单列竖直流（标题行 + 进度条 + 列表）
 *     - 4×2 比 2×2 更高，自然能塞更多列表项（条数由 JS 按容器高度估算）
 *   - 详情面板：左侧分组（今日 / 计划 / 已完成 / 全部）；右侧列表 + 快速添加
 *   - 用 --todo-color 作为主题色（绿）
 */

/* ============================================================
 * 桌面卡片：2×2 / 4×2 共用单列布局
 * ============================================================ */
.halotab-widget-todo {
  --todo-color: #22c55e;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.4cqi, 7px);
  width: 100%;
  height: 100%;
  padding: clamp(5px, 1.8cqi, 7px) clamp(6px, 2cqi, 8px);
  box-sizing: border-box;
  text-align: left;
  color: #1f2937;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--todo-color) 18%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, #ecfdf3 0%, #d6f7e0 60%, #b5edc7 100%);
  border-radius: inherit;
  cursor: pointer;
  overflow: hidden;
}

/* 头部：标题 + 完成统计 */
.halotab-widget-todo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
.halotab-widget-todo-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.halotab-widget-todo-title-ico {
  flex: 0 0 auto;
  width: clamp(16px, 5.5cqi, 22px);
  height: clamp(16px, 5.5cqi, 22px);
  color: var(--todo-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.halotab-widget-todo-title-ico svg { width: 100%; height: 100%; display: block; }
.halotab-widget-todo-title-text {
  font-size: clamp(13px, 4.4cqi, 16px);
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.halotab-widget-todo-stats {
  flex: 0 0 auto;
  font-size: clamp(10px, 3.2cqi, 12px);
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

/* 进度条 */
.halotab-widget-todo-progress {
  flex: 0 0 auto;
  display: block;
}
.halotab-widget-todo-progress-track {
  display: block;
  height: clamp(4px, 1.6cqi, 6px);
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  overflow: hidden;
}
.halotab-widget-todo-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--todo-color) 70%, #fff), var(--todo-color));
  transition: width .4s ease;
}

/* 列表（单列，支持滚动） */
.halotab-widget-todo-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 1.4cqi, 7px);
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* 细滚动条 */
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, .25) transparent;
  -webkit-overflow-scrolling: touch;
}
.halotab-widget-todo-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.halotab-widget-todo-list::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, .2);
  border-radius: 999px;
}
.halotab-widget-todo-list::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, .35);
}
.halotab-widget-todo-list::-webkit-scrollbar-track {
  background: transparent;
}
.halotab-widget-todo-item {
  --todo-prio-color: #6c6c6c;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: clamp(11px, 3.4cqi, 13px);
  line-height: 1.25;
  color: #1f2937;
  min-width: 0;
  background: rgba(255, 255, 255, .7);
  border: 1px solid color-mix(in srgb, var(--todo-color) 18%, transparent);
  border-radius: 8px;
  transition: background .2s ease, border-color .2s ease;
}
.halotab-widget-todo-item-dot {
  flex: 0 0 auto;
  width: clamp(5px, 1.8cqi, 8px);
  height: clamp(5px, 1.8cqi, 8px);
  border-radius: 50%;
  background: var(--todo-prio-color);
}
.halotab-widget-todo-item-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.halotab-widget-todo-item[data-done="true"] .halotab-widget-todo-item-name {
  text-decoration: line-through;
  color: #94a3b8;
}
.halotab-widget-todo-item-check {
  flex: 0 0 auto;
  width: clamp(12px, 3.8cqi, 14px);
  height: clamp(12px, 3.8cqi, 14px);
  border-radius: 3px;
  border: 1.5px solid color-mix(in srgb, currentColor 35%, transparent);
  background: transparent;
  position: relative;
}
.halotab-widget-todo-item[data-done="true"] .halotab-widget-todo-item-check {
  background: var(--todo-color);
  border-color: var(--todo-color);
}
.halotab-widget-todo-item[data-done="true"] .halotab-widget-todo-item-check::after {
  content: "";
  position: absolute;
  left: 50%; top: 48%;
  width: 30%; height: 60%;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -55%) rotate(45deg);
}

/* 空态 */
.halotab-widget-todo-empty {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px;
  text-align: left;
  color: #64748b;
  --todo-color: #22c55e;
  background:
    radial-gradient(70% 90% at 20% 30%, color-mix(in srgb, var(--todo-color) 14%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, #fff 0%, #ecfdf3 100%);
  z-index: 2;
}
.halotab-widget-todo.is-empty .halotab-widget-todo-empty { display: flex; }
.halotab-widget-todo-empty-art {
  flex: 0 0 auto;
  width: clamp(72px, 24cqi, 110px);
  color: var(--todo-color);
}
.halotab-widget-todo-empty-art svg { width: 100%; height: auto; display: block; }
.halotab-widget-todo-empty-text {
  display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-width: 0;
}
.halotab-widget-todo-empty-title {
  font-size: clamp(13px, 4.6cqi, 16px);
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}
.halotab-widget-todo-empty-tip {
  font-size: clamp(10px, 3.4cqi, 12px);
  line-height: 1.5;
  color: #64748b;
}
.halotab-widget-todo-empty-cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: clamp(11px, 3.6cqi, 13px);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(34, 197, 94, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.halotab-widget-todo-empty-cta::before {
  content: "+"; margin-right: 4px; font-weight: 700; font-size: 1.05em; line-height: 1;
}

/* ============================================================
 * 桌面卡片 · 2×2 专属紧凑布局
 * ------------------------------------------------------------
 * 思路：
 *   2×2 内宽很窄（~140px），原本按容器宽度 cqi 缩放的字号会全部贴
 *   到 clamp 的 min 值，看着小且死板。这里针对 2×2 用绝对 px 把
 *   字号定档，并：
 *     - 去掉右侧空 check 装饰方块（小尺寸下纯占位、挤掉文字宽度）
 *     - 去掉装饰性 dot（小尺寸下颜色信息已足够融合到文字旁，少一个
 *       视觉碎片）
 *     - 收紧 item padding / gap，让每行更紧凑、列表能多塞几条
 *     - "已完成 X / Y" 改为更紧凑的 "X/Y"
 * ============================================================ */
.halotab-card[data-size="2x2"] .halotab-widget-todo {
  gap: 5px;
  padding: 8px 9px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-title-ico {
  width: 16px;
  height: 16px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-title-text {
  font-size: 13px;
  letter-spacing: .2px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-stats {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-progress-track {
  height: 4px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-list {
  gap: 4px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-item {
  gap: 6px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.3;
  border-radius: 6px;
}
/* 2×2 下隐藏装饰元素，把空间全留给文字 */
.halotab-card[data-size="2x2"] .halotab-widget-todo-item-dot,
.halotab-card[data-size="2x2"] .halotab-widget-todo-item-check {
  display: none;
}
/* 2×2 下用左 border 替代 dot 表示优先级（不占行内宽度） */
.halotab-card[data-size="2x2"] .halotab-widget-todo-item {
  border-left: 2px solid var(--todo-prio-color);
}

/* 2×2 空态：原布局是横向 art+text+cta，插画 110px 已经吃掉容器一半宽度，
   旁边的标题/提示/按钮被挤成一团甚至溢出。这里改成竖直堆叠 + 缩小插画 +
   隐藏长提示文案，只保留：小插画 + 「还没有待办」标题 + 「新建待办」按钮 */
.halotab-card[data-size="2x2"] .halotab-widget-todo-empty {
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  text-align: center;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-empty-art {
  width: 56px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-empty-text {
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-empty-title {
  font-size: 13px;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-empty-tip {
  font-size: 10px;
  line-height: 1.35;
  /* 限两行，超出省略，避免撑破卡片 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.halotab-card[data-size="2x2"] .halotab-widget-todo-empty-cta {
  padding: 5px 12px;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, .3);
}

/* 暗色卡片 */
html[data-theme="dark"] .halotab-widget-todo,
html[data-theme="auto"] .halotab-widget-todo {
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--todo-color) 28%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, #102218 0%, #0c1b13 100%);
  color: #e5e7eb;
}
html[data-theme="dark"] .halotab-widget-todo .halotab-widget-todo-title-text,
html[data-theme="auto"] .halotab-widget-todo .halotab-widget-todo-title-text { color: #f1f5f9; }
html[data-theme="dark"] .halotab-widget-todo-stats,
html[data-theme="auto"] .halotab-widget-todo-stats { color: #94a3b8; }
html[data-theme="dark"] .halotab-widget-todo-progress-track,
html[data-theme="auto"] .halotab-widget-todo-progress-track { background: rgba(148, 163, 184, .25); }
html[data-theme="dark"] .halotab-widget-todo-item,
html[data-theme="auto"] .halotab-widget-todo-item {
  color: #e5e7eb;
  background: rgba(255, 255, 255, .06);
  border-color: color-mix(in srgb, var(--todo-color) 25%, transparent);
}
html[data-theme="dark"] .halotab-widget-todo-item[data-done="true"] .halotab-widget-todo-item-name,
html[data-theme="auto"] .halotab-widget-todo-item[data-done="true"] .halotab-widget-todo-item-name { color: #64748b; }
html[data-theme="dark"] .halotab-widget-todo-empty,
html[data-theme="auto"] .halotab-widget-todo-empty {
  background:
    radial-gradient(70% 90% at 20% 30%, color-mix(in srgb, var(--todo-color) 28%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #94a3b8;
}
html[data-theme="dark"] .halotab-widget-todo-empty-title,
html[data-theme="auto"] .halotab-widget-todo-empty-title { color: #f1f5f9; }


/* ============================================================
 * 详情面板（appBox 内）
 * ============================================================ */
.ht-appbox-body[data-key="todo"] { padding: 0; height: 100%; }

.ht-td-app {
  --td-color: #22c55e;
  --td-text: #1f2937;
  --td-text-soft: #64748b;
  --td-bg: #f8fafc;
  --td-card-bg: #ffffff;
  --td-border: #e2e8f0;
  --td-prio-high: #ef4444;
  --td-prio-mid:  #f59e0b;
  --td-prio-low:  #94a3b8;
  --td-prio-normal: #94a3b8;
  display: grid;
  grid-template-columns: 240px 1fr;
  width: 100%;
  height: 100%;
  background: var(--td-bg);
  color: var(--td-text);
  font-size: 14px;
  overflow: hidden;
}

/* ---------- 左列：分组 ---------- */
.ht-td-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--td-border);
  background: var(--td-card-bg);
  min-height: 0;
}
.ht-td-side-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--td-border);
  flex: 0 0 auto;
}
.ht-td-side-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--td-text);
}
.ht-td-groups {
  list-style: none;
  margin: 0;
  padding: 8px;
  flex: 1 1 auto;
  overflow: auto;
}
.ht-td-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ht-td-group:hover { background: #f1f5f9; }
.ht-td-group.is-active {
  background: color-mix(in srgb, var(--td-color) 14%, transparent);
  color: color-mix(in srgb, var(--td-color) 80%, #000);
}
.ht-td-group-ico { font-size: 16px; flex: 0 0 auto; }
.ht-td-group-name { flex: 1 1 0; font-weight: 500; }
.ht-td-group-count {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 8px;
  text-align: center;
  border-radius: 999px;
  background: rgba(148, 163, 184, .18);
  color: var(--td-text-soft);
  font-size: 11px;
  font-weight: 700;
}
.ht-td-group.is-active .ht-td-group-count {
  background: var(--td-color);
  color: #fff;
}

.ht-td-side-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--td-border);
  font-size: 11px;
  color: var(--td-text-soft);
  flex: 0 0 auto;
}

/* ---------- 右列：列表区 ---------- */
.ht-td-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ht-td-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 10px;
  flex: 0 0 auto;
}
.ht-td-bar-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--td-text);
}
.ht-td-bar-tools {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  color: var(--td-text-soft);
}
.ht-td-bar-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}
.ht-td-bar-toggle input { margin: 0; }

/* 顶部添加栏 */
.ht-td-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 24px 14px;
  padding: 6px;
  background: var(--td-card-bg);
  border: 1px solid var(--td-border);
  border-radius: 10px;
  flex: 0 0 auto;
  transition: border-color .15s, box-shadow .15s;
}
.ht-td-add:focus-within {
  border-color: var(--td-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--td-color) 15%, transparent);
}
.ht-td-add-prio {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.ht-td-add-prio:hover { background: #f1f5f9; }
.ht-td-add-priodot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--td-prio-normal);
  transition: background .15s;
}
.ht-td-add-prio[data-prio="high"] .ht-td-add-priodot   { background: var(--td-prio-high); }
.ht-td-add-prio[data-prio="mid"]  .ht-td-add-priodot   { background: var(--td-prio-mid); }
.ht-td-add-prio[data-prio="low"]  .ht-td-add-priodot   { background: var(--td-prio-low); }
.ht-td-add-input {
  flex: 1 1 auto;
  height: 28px;
  border: 0;
  outline: none;
  font-size: 14px;
  color: var(--td-text);
  background: transparent;
  font-family: inherit;
  min-width: 0;
}
.ht-td-add-date {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--td-text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ht-td-add-date:hover { background: #f1f5f9; color: var(--td-text); }
.ht-td-add-date[data-has="true"] { color: var(--td-color); }
.ht-td-add-dateinput {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.ht-td-add-submit {
  flex: 0 0 auto;
  border: 0;
  padding: 6px 16px;
  border-radius: 6px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}
.ht-td-add-submit:hover { filter: brightness(1.08); }

/* 列表 */
.ht-td-listbox {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 24px 20px;
}
.ht-td-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ht-td-list-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 60px 20px;
  text-align: center;
  color: var(--td-text-soft);
}
.ht-td-list-empty.is-show { display: flex; }
.ht-td-list-empty-ico { font-size: 48px; }
.ht-td-list-empty-title { font-size: 16px; font-weight: 700; color: var(--td-text); }
.ht-td-list-empty-tip { font-size: 13px; }

.ht-td-item {
  --td-prio-color: var(--td-prio-normal);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--td-card-bg);
  border: 1px solid var(--td-border);
  border-left: 3px solid var(--td-prio-color);
  transition: background .15s, border-color .15s, opacity .2s;
}
.ht-td-item:hover { border-color: color-mix(in srgb, var(--td-prio-color) 50%, var(--td-border)); }
.ht-td-item[data-done="true"] {
  opacity: .55;
  background: #f8fafc;
}

.ht-td-item-check {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 2px solid var(--td-prio-color);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .15s;
}
.ht-td-item-check:hover { background: color-mix(in srgb, var(--td-prio-color) 15%, transparent); }
.ht-td-item[data-done="true"] .ht-td-item-check { background: var(--td-prio-color); }
.ht-td-item-check svg { display: none; }
.ht-td-item[data-done="true"] .ht-td-item-check svg { display: block; }

.ht-td-item-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ht-td-item-text {
  font-size: 14px;
  color: var(--td-text);
  word-break: break-word;
  cursor: text;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.ht-td-item-text:focus {
  background: color-mix(in srgb, var(--td-color) 8%, transparent);
}
.ht-td-item[data-done="true"] .ht-td-item-text {
  text-decoration: line-through;
  color: var(--td-text-soft);
}
.ht-td-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--td-text-soft);
}
.ht-td-item-meta-tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .15);
}
.ht-td-item-meta-tag[data-overdue="true"] {
  background: rgba(239, 68, 68, .15);
  color: var(--td-prio-high);
}
.ht-td-item-meta-tag[data-due="today"] {
  background: rgba(245, 158, 11, .15);
  color: var(--td-prio-mid);
}

.ht-td-item-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  /* 删除按钮一直展示（不再隐藏到 hover 才出现） */
}
.ht-td-item-act {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--td-text-soft);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ht-td-item-act:hover { background: #f1f5f9; color: var(--td-text); }
.ht-td-item-act-del:hover { background: #fee2e2; color: #dc2626; }

/* 置顶按钮（替代原优先级切换按钮） */
.ht-td-item-pin {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--td-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.ht-td-item-pin:hover { background: #f1f5f9; color: var(--td-text); }
.ht-td-item-pin svg { display: block; }
/* 已置顶：高亮 + 实心填充 */
.ht-td-item[data-pinned="true"] .ht-td-item-pin {
  color: var(--td-color, #22c55e);
}
.ht-td-item[data-pinned="true"] .ht-td-item-pin svg {
  fill: currentColor;
}
/* 行尾的小置顶角标 */
.ht-td-item[data-pinned="true"] {
  background: color-mix(in srgb, var(--td-color, #22c55e) 6%, transparent);
}

/* ---------- 暗色：详情面板 ---------- */
html[data-theme="dark"] .ht-td-app,
html[data-theme="auto"] .ht-td-app {
  --td-text: #e5e7eb;
  --td-text-soft: #94a3b8;
  --td-bg: #0f172a;
  --td-card-bg: #1e293b;
  --td-border: rgba(148, 163, 184, .2);
}
html[data-theme="dark"] .ht-td-group:hover,
html[data-theme="auto"] .ht-td-group:hover { background: #334155; }
html[data-theme="dark"] .ht-td-add-input,
html[data-theme="auto"] .ht-td-add-input { color: #e5e7eb; }
html[data-theme="dark"] .ht-td-item[data-done="true"],
html[data-theme="auto"] .ht-td-item[data-done="true"] { background: #172033; }
html[data-theme="dark"] .ht-td-item-act:hover,
html[data-theme="auto"] .ht-td-item-act:hover { background: #334155; color: #e5e7eb; }
html[data-theme="dark"] .ht-td-item-pin:hover,
html[data-theme="auto"] .ht-td-item-pin:hover { background: #334155; color: #e5e7eb; }
html[data-theme="dark"] .ht-td-item[data-pinned="true"],
html[data-theme="auto"] .ht-td-item[data-pinned="true"] { background: color-mix(in srgb, var(--td-color, #22c55e) 12%, #1e293b); }
html[data-theme="dark"] .ht-td-add-prio:hover,
html[data-theme="dark"] .ht-td-add-date:hover,
html[data-theme="auto"] .ht-td-add-prio:hover,
html[data-theme="auto"] .ht-td-add-date:hover { background: #334155; }

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
  .ht-td-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .ht-td-side {
    border-right: 0;
    border-bottom: 1px solid var(--td-border);
  }
  .ht-td-groups {
    display: flex;
    overflow-x: auto;
    padding: 8px;
  }
  .ht-td-group {
    flex: 0 0 auto;
    margin-bottom: 0;
    margin-right: 6px;
  }
  .ht-td-bar { padding: 12px 16px 8px; }
  .ht-td-add { margin: 0 16px 12px; }
  .ht-td-listbox { padding: 0 16px 16px; }
}
