/* The site's one confirmation dialog. It used to be a stack of Tailwind utility
   classes - a grey box, a red button and nothing else - which read as a browser
   confirm() with a coat of paint. It is the last thing a reader sees before
   something is deleted, so it is worth the same care as the pages it interrupts:
   the cream, the 深棕 heading and the rounded cards this site uses everywhere.
   The markup is unchanged - class="confirmation" plus data-confirm-message. */
#confirm-modal {
  background: none;
  border: 0;
  color: #3d382c;
  margin: auto;
  max-width: min(30rem, calc(100vw - 2rem));
  overflow: visible;
  padding: 0;
  width: 100%;
}

#confirm-modal::backdrop {
  backdrop-filter: blur(3px);
  background-color: rgba(35, 30, 20, 0.45);
}

.cm__card {
  background-color: #fdfcf5;
  outline: none;
  border: 1px solid #e2dcc6;
  border-radius: 16px;
  box-shadow:
    0 18px 44px rgba(40, 32, 18, 0.22),
    0 2px 6px rgba(40, 32, 18, 0.08);
  padding: 22px 24px 18px;
}

/* The mark carries the weight the old dialog put on a red button, so 确定 does
   not have to shout to say what kind of question this is. */
.cm__mark {
  align-items: center;
  background-color: #f6e7e2;
  border-radius: 999px;
  color: #a8342b;
  display: flex;
  flex: none;
  font-size: 1.05em;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.cm__head {
  align-items: center;
  display: flex;
  gap: 12px;
}

.cm__title {
  color: #4e0d0d;
  font-size: 1.1em;
  font-weight: 600;
  margin: 0;
}

.cm__message {
  color: #5c5546;
  font-size: 1em;
  line-height: 1.7;
  margin: 12px 0 20px;
  /* Lined up under the title rather than under the mark: the mark is a label for
     the whole dialog, not a bullet on the first line. */
  padding-left: 50px;
}

.cm__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cm__btn {
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95em;
  min-width: 88px;
  padding: 8px 20px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.cm__btn:focus-visible {
  outline: 2px solid #4a7c59;
  outline-offset: 2px;
}

.cm__btn--quiet {
  background-color: #f3f0e4;
  border-color: #ddd8c4;
  color: #5c5546;
}

.cm__btn--quiet:hover {
  background-color: #fff;
}

.cm__btn--go {
  background-color: #a8342b;
  color: #fff;
}

.cm__btn--go:hover {
  background-color: #8d2a22;
}

/* An action that only saves or sends is not a warning. data-confirm-tone="calm"
   puts it in the green these pages use for anything you act on. */
#confirm-modal[data-tone="calm"] .cm__mark {
  background-color: #e6efe7;
  color: #4a7c59;
}

#confirm-modal[data-tone="calm"] .cm__btn--go {
  background-color: #4a7c59;
}

#confirm-modal[data-tone="calm"] .cm__btn--go:hover {
  background-color: #3d6a4a;
}

#confirm-modal[open] {
  animation: cm-rise 0.16s ease-out;
}

#confirm-modal[open]::backdrop {
  animation: cm-fade 0.16s ease-out;
}

@keyframes cm-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

@keyframes cm-fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #confirm-modal[open],
  #confirm-modal[open]::backdrop {
    animation: none;
  }
}

@media (max-width: 480px) {
  .cm__message {
    padding-left: 0;
  }

  .cm__btn {
    flex: 1 1 0;
  }
}
