* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f7;
  color: #1f2937;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  width: 100%;
  max-width: 560px;
  height: fit-content;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 0;
  font-size: 26px;
}

.subtitle {
  margin: 6px 0 20px;
  color: #6b7280;
  font-size: 14px;
}

#add-form {
  display: flex;
  gap: 8px;
}

#new-todo {
  flex: 1;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  outline: none;
}

#new-todo:focus {
  border-color: #2563eb;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  padding: 12px 18px;
  background: #2563eb;
  color: #fff;
}

button:hover { background: #1d4ed8; }

.filters {
  display: flex;
  gap: 8px;
  margin: 16px 0 8px;
  flex-wrap: wrap;
}

.filters button {
  background: #eef2f7;
  color: #374151;
  padding: 8px 14px;
  font-size: 14px;
}

.filters button.active {
  background: #2563eb;
  color: #fff;
}

.filters button.danger {
  margin-left: auto;
  background: #fef2f2;
  color: #dc2626;
}

#todo-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

#todo-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
}

#todo-list li:last-child { border-bottom: none; }

#todo-list li input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

#todo-list li .text { flex: 1; word-break: break-all; }

#todo-list li.done .text {
  color: #9ca3af;
  text-decoration: line-through;
}

#todo-list li .del {
  background: none;
  color: #9ca3af;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
}

#todo-list li .del:hover { color: #dc2626; }

.empty {
  text-align: center;
  color: #9ca3af;
  padding: 20px 0;
}

.counter {
  margin: 16px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.footnote {
  margin: 6px 0 0;
  color: #9ca3af;
  font-size: 12px;
}
