/* ============================================================
 *  Widgets · 待办 / 笔记 / RSS
 * ============================================================ */

/* ===== 待办 ===== */
.todo-input-row {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}
.todo-input-row input {
  flex: 1;
  min-width: 0;              /* 关键：允许收缩 */
  padding: 0.55rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text-bright);
  transition: border 0.12s;
  min-height: 36px;
  width: 100%;
}
.todo-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.todo-input-row input::placeholder {
  color: var(--text-muted);
}
.todo-input-row button {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background-color: var(--accent);
  color: #0d1117;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  font-family: var(--font-mono);
  line-height: 1;
}
body.light .todo-input-row button { color: #fffbf0; }
.todo-input-row button:hover {
  background-color: var(--accent-dim);
  box-shadow: 0 0 12px var(--accent-glow);
}
.todo-input-row button:active { transform: scale(0.94); }

.todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
  font-family: var(--font-ui);
  font-size: 0.83rem;
  border-left: 2px solid transparent;
  line-height: 1.4;
}
.todo-item:hover {
  background-color: var(--bg-subtle);
  border-left-color: var(--accent);
}
.todo-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.todo-item .todo-text {
  flex: 1;
  word-break: break-word;
  min-width: 0;
  line-height: 1.4;
}
.todo-item.done .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.todo-item .todo-del {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.12s;
  font-family: var(--font-mono);
  line-height: 1;
  padding: 0;
}
.todo-item:hover .todo-del { opacity: 1; }
.todo-item .todo-del:hover {
  background-color: var(--red);
  color: #0d1117;
}

/* ===== 快速笔记 ===== */
#notesArea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 0.65rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.6;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text-bright);
  transition: border 0.12s;
  box-sizing: border-box;
}
#notesArea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#notesArea::placeholder {
  color: var(--text-muted);
}
#notesStatus {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
#notesStatus.saving { color: var(--accent); }

/* ===== RSS ===== */
.rss-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-height: 260px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}
.rss-list .rss-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-ui);
}
.rss-list .rss-empty::before {
  content: '// ';
  opacity: 0.6;
  font-family: var(--font-mono);
}
.rss-item {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.83rem;
  transition: all 0.12s;
  border-left: 2px solid transparent;
  font-family: var(--font-ui);
}
.rss-item:hover {
  background-color: var(--bg-subtle);
  border-left-color: var(--accent);
  color: var(--text-bright);
}
.rss-item .rss-source {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.rss-item .rss-source::before {
  content: '@ ';
  opacity: 0.6;
}
.rss-item .rss-title {
  font-family: var(--font-ui);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rss-item:hover .rss-title {
  color: var(--accent);
}
.rss-loading {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-ui);
}
.rss-loading::after {
  content: '...';
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}