* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  padding: 20px 16px;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

h1 {
  background: #4a7fc1;
  color: #fff;
  text-align: center;
  padding: 20px;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}

.input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid #e8ecf0;
}

.input-area input {
  flex: 1;
  border: 1px solid #c8d0dc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-area input:focus {
  border-color: #4a7fc1;
}

.input-area button {
  background: #4a7fc1;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.input-area button:hover {
  background: #3a6aaa;
}

.filter-area {
  display: flex;
  gap: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #e8ecf0;
}

.filter-btn {
  flex: 1;
  background: none;
  border: 1px solid #c8d0dc;
  padding: 8px 4px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #666;
  transition: background 0.2s, color 0.2s;
}

.filter-btn:first-child {
  border-radius: 8px 0 0 8px;
}

.filter-btn:last-child {
  border-radius: 0 8px 8px 0;
}

.filter-btn + .filter-btn {
  border-left: none;
}

.filter-btn.active {
  background: #4a7fc1;
  color: #fff;
  border-color: #4a7fc1;
}

#taskList {
  list-style: none;
  min-height: 60px;
  padding: 8px 0;
}

#taskList li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.15s;
}

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

#taskList li:hover {
  background: #f8fafc;
}

#taskList li.done .task-text {
  text-decoration: line-through;
  color: #aab;
}

.task-check {
  width: 22px;
  height: 22px;
  border: 2px solid #c8d0dc;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.task-check:hover {
  border-color: #4a7fc1;
}

li.done .task-check {
  background: #4a7fc1;
  border-color: #4a7fc1;
}

li.done .task-check::after {
  content: "✓";
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
}

.task-text {
  flex: 1;
  font-size: 1rem;
  word-break: break-word;
  line-height: 1.4;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: #e05050;
}

.empty-msg {
  text-align: center;
  color: #aab;
  padding: 32px 16px;
  font-size: 0.9rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #e8ecf0;
  background: #f8fafc;
}

#remainCount {
  font-size: 0.85rem;
  color: #888;
}

#clearDoneBtn {
  background: none;
  border: 1px solid #e05050;
  color: #e05050;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#clearDoneBtn:hover {
  background: #e05050;
  color: #fff;
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.2rem;
    padding: 16px;
  }

  .input-area {
    flex-direction: column;
  }

  .input-area button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
