body {
  margin: 0;
  color: #666666;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  background-color: #fffff0;
  background-image:
    linear-gradient(45deg, rgba(248, 200, 220, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(230, 230, 250, 0.08) 25%, transparent 25%);
  background-size: 22px 22px;
}

.page-container {
  position: relative;
  z-index: 1;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #f3d7e7;
}

.soft-input {
  border-color: #f8c8dc;
  background: #fffdf8;
}

.soft-input:focus {
  outline: 2px solid #e6e6fa;
  border-color: #e6e6fa;
}

.btn-soft {
  background: #f8c8dc;
  color: #5f4b56;
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(248, 200, 220, 0.45);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-soft:hover {
  transform: scale(1.02);
  background: #f0b6d0;
  cursor: pointer;
}

.btn-soft:active {
  transform: scale(0.98);
}

.btn-soft:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cell {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid #e6d7ff;
  background: #fffbff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cell.safe {
  background: #f0fdf4;
  border-color: #86efac;
}

.cell.event {
  background: #fff1f7;
  border-color: #f8c8dc;
}

.cell.finish {
  background: #ecfeff;
  border-color: #67e8f9;
}

.cell-index {
  font-size: 11px;
  color: #64748b;
}

.token-wrap {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.token {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.task-dialog {
  border: 0;
  border-radius: 12px;
  width: min(92vw, 460px);
  padding: 18px;
}

.task-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 9px 16px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: #90c49a;
}

.toast.error {
  background: #f39bb9;
}

.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  animation: rotate-loader 1s linear infinite;
  display: none;
  z-index: 1000;
}

.loader.show {
  display: block;
}

.result-highlight {
  animation: pulse-highlight 0.8s ease;
}

@keyframes rotate-loader {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes pulse-highlight {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(248, 200, 220, 0.2);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(248, 200, 220, 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(248, 200, 220, 0.2);
  }
}

@media (max-width: 768px) {
  .page-container {
    padding: 16px !important;
  }

  .board {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .btn-soft {
    min-height: 46px;
    font-size: 16px;
  }
}
