* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #13315c;
  background:
    radial-gradient(circle at top left, rgba(255, 122, 193, 0.28), transparent 28%),
    linear-gradient(135deg, #eef7ff 0%, #ffffff 48%, #ffeaf5 100%);
}

.page-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 560px);
  gap: 24px;
  align-items: start;
  justify-content: center;
  width: min(94vw, 920px);
  margin: 48px auto;
}

.app,
.heatmap-panel {
  padding: 28px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.14);
  backdrop-filter: blur(14px);
}

.heatmap-panel {
  position: sticky;
  top: 24px;
}

.stats {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.stats p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #1d4ed8;
  font-weight: 700;
}

.stats span {
  color: #db2777;
  font-size: 24px;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.heatmap-day {
  aspect-ratio: 1;
  border: 1px solid #dbeafe;
  border-radius: 5px;
  background: #eff6ff;
}

.heatmap-day.level-1 {
  background: #bfdbfe;
}

.heatmap-day.level-2 {
  background: #93c5fd;
}

.heatmap-day.level-3 {
  background: #f9a8d4;
}

.heatmap-day.level-4 {
  background: #ec4899;
}

h1 {
  margin: 0 0 12px;
  font-size: 28px;
  text-align: center;
  color: #1d4ed8;
}

.quote-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px solid #fbcfe8;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff, #fff7fb);
}

.quote-card p {
  margin: 0;
  color: #be185d;
  font-weight: 700;
  line-height: 1.5;
}

.quote-card button {
  height: 34px;
  padding: 0 12px;
  border-color: #f9a8d4;
  color: #be185d;
  background: #fff;
}

.todo-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.input-area {
  min-width: 0;
}

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  outline: none;
  color: #13315c;
  background: #f8fbff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input.input-error {
  border-color: #ec4899;
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.13);
}

.error-message {
  min-height: 18px;
  margin: 6px 0 0;
  color: #db2777;
  font-size: 14px;
}

button {
  height: 42px;
  padding: 0 16px;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #ffffff;
  color: #1d4ed8;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  background: #eff6ff;
  transform: translateY(-1px);
}

.todo-form button {
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #ec4899);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.todo-form button:hover {
  background: linear-gradient(135deg, #1d4ed8, #db2777);
}

.filters {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.filter-button.active {
  border-color: #ec4899;
  color: #be185d;
  background: #fdf2f8;
}

.todo-list {
  max-height: 360px;
  min-height: 80px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 6px 4px 0;
  list-style: none;
  border-top: 1px solid #dbeafe;
  scroll-behavior: smooth;
  perspective: 900px;
}

.todo-list::-webkit-scrollbar {
  width: 8px;
}

.todo-list::-webkit-scrollbar-thumb {
  background: linear-gradient(#93c5fd, #f9a8d4);
  border-radius: 999px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
  transform-origin: top center;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.todo-item.is-new {
  animation: flip-in 0.42s ease both;
}

.todo-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ec4899;
}

.todo-text {
  word-break: break-word;
}

.todo-content {
  min-width: 0;
}

.todo-time {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.todo-item.completed .todo-text {
  color: #8aa3c7;
  text-decoration: line-through;
}

.extend-button {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.extend-button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.delete-button {
  border-color: #fbcfe8;
  color: #be185d;
  background: #fff7fb;
}

.todo-footer {
  margin-top: 18px;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 700;
}

@keyframes flip-in {
  from {
    opacity: 0;
    transform: rotateX(-82deg) translateY(-12px);
  }

  to {
    opacity: 1;
    transform: rotateX(0) translateY(0);
  }
}

@media (max-width: 760px) {
  .page-shell {
    grid-template-columns: 1fr;
    margin: 20px auto;
  }

  .heatmap-panel {
    position: static;
    padding: 20px;
  }

  .app {
    padding: 20px;
  }

  .todo-form {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-wrap: wrap;
  }

  .todo-item {
    grid-template-columns: auto 1fr;
  }

  .extend-button,
  .delete-button {
    grid-column: 2;
    width: fit-content;
  }
}
