* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 600px;
  margin: 40px auto;
  padding: 20px;
  background: #f5f5f5;
}
h1 {
  margin-bottom: 20px;
  color: #333;
}
.input-area {
  margin-bottom: 20px;
}
#textInput {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
}
#textInput:focus {
  border-color: #007bff;
}
.hint {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}
.history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.item {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  position: relative;
}
.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.item.text-item {
  word-break: break-word;
}
.item .text-content {
  white-space: pre-wrap;
}
.item.image-item img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
}
.item .label {
  position: absolute;
  top: 8px;
  right: 40px;
  font-size: 12px;
  color: #999;
}
.item .delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.2s,
    background 0.2s,
    color 0.2s;
}
.item:hover .delete {
  opacity: 1;
}
.item .delete:hover {
  background: #dc3545;
  color: white;
}
.item .edit {
  position: absolute;
  top: 8px;
  right: 40px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.2s,
    background 0.2s,
    color 0.2s;
}
.item:hover .edit {
  opacity: 1;
}
.item .edit:hover {
  background: #007bff;
  color: white;
}
.item .copy {
  position: absolute;
  top: 8px;
  right: 72px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.2s,
    background 0.2s,
    color 0.2s;
}
.item:hover .copy {
  opacity: 1;
}
.item .copy:hover {
  background: #28a745;
  color: white;
}
.item.edit-mode {
  padding: 12px;
}
.item.edit-mode .text-content,
.item.edit-mode .label,
.item.edit-mode .delete,
.item.edit-mode .edit,
.item.edit-mode .copy {
  display: none;
}
.item.edit-mode textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
}
.item.edit-mode .edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.item.edit-mode .edit-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.item.edit-mode .edit-actions .save {
  background: #28a745;
  color: white;
}
.item.edit-mode .edit-actions .cancel {
  background: #6c757d;
  color: white;
}
.empty {
  text-align: center;
  color: #999;
  padding: 40px;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show {
  opacity: 1;
}
.toast.undo-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.undo-toast.show {
  opacity: 1;
}
.toast.undo-toast button {
  background: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.toast.undo-toast button:hover {
  background: #0056b3;
}
