/* 通知中心頁面 */
body[p="notifications"] .SettingMain .setting {
  display: block;
  width: min(960px, 100%);
  max-width: 960px;
  margin: 0 auto;
  padding: 30px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(92 72 48 / 8%);
}

.notificationsHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 2px dashed #b9b9b9;
}

.notificationsHeader h1 {
  margin: 0;
  color: #716552;
  font-size: 28px;
}

.notificationsHeader p {
  margin: 8px 0 0;
  color: #92877a;
  font-size: 14px;
}

.notificationsMarkAll {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 17px;
  color: #6e6252;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  border: 1px solid #cfc2b2;
  border-radius: 999px;
}

.notificationsMarkAll:hover,
.notificationsMarkAll:focus-visible {
  color: #fff;
  background: #91846f;
  outline: none;
}

.notificationsMarkAll:disabled {
  cursor: wait;
  opacity: 0.55;
}

.notificationsList {
  display: grid;
  gap: 12px;
  padding-top: 24px;
}

.notificationCard {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  cursor: pointer;
  background: #fbf9f6;
  border-left: 4px solid #cdbb9d;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.notificationCard.is-unread {
  background: #f8f1e7;
  border-left-color: #b98e43;
}

.notificationCard.is-read {
  border-left-color: #ffffff;
}

.notificationCard:hover,
.notificationCard:focus-visible {
  background: #f0e7d8;
}

.notificationCard.is-unread:hover,
.notificationCard.is-unread:focus-visible {
  background: #f3e5d0;
}

.notificationCard__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.notificationCard__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #514a41;
  font-size: 17px;
  font-weight: 700;
}

.notificationCard__scope {
  padding: 3px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  background: #91846f;
  border-radius: 999px;
  white-space: nowrap;
}

.notificationCard.is-unread .notificationCard__scope {
  background: #b98e43;
}

.notificationCard__scope--system {
  background: #ce7651;
}

.notificationCard__scope--company {
  background: #6fb176;
  white-space: normal;
}

.notificationCard.is-unread .notificationCard__scope--system {
  background: #ce7651;
}

.notificationCard.is-unread .notificationCard__scope--company {
  background: #6fb176;
}

.notificationCard__time {
  color: #a39a90;
  font-size: 12px;
  white-space: nowrap;
}

.notificationCard__content {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: #6f675e;
  font-size: 15px;
  line-height: 1.7;
}

.notificationCard:focus-visible {
  outline: 2px solid #b98e43;
  outline-offset: 3px;
}

.notificationModal[hidden] {
  display: none;
}

.notificationModal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.notificationModal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(54 48 42 / 45%);
}

.notificationModal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(620px, calc(100dvh - 48px));
  overflow-y: auto;
  padding: 30px;
  background: #fff;
  box-shadow: 0 14px 38px rgb(54 48 42 / 25%);
}

.notificationModal__dialog.is-loading > :not(.notificationModal__close, .notificationModal__loading) {
  visibility: hidden;
}

.notificationModal__loading {
  display: grid;
  min-height: 210px;
  place-content: center;
  gap: 14px;
  color: #92877a;
  text-align: center;
}

.notificationModal__loading[hidden] {
  display: none;
}

.notificationModal__loading p {
  margin: 0;
  color: inherit;
  font-size: 15px;
}

.notificationModal__spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid #e5d8c7;
  border-top-color: #a98344;
  border-radius: 50%;
  animation: notificationSpin 0.75s linear infinite;
}

@keyframes notificationSpin {
  to {
    transform: rotate(360deg);
  }
}

.notificationModal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #6e6252;
  cursor: pointer;
  background: #fff;
  border: 1px solid #d7cbbb;
  border-radius: 50%;
}

.notificationModal__close:hover,
.notificationModal__close:focus-visible {
  color: #fff;
  background: #91846f;
  outline: none;
}

.notificationModal__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notificationModal__meta .notificationCard__scope {
  display: inline-block;
}

.notificationModal__dialog h2 {
  margin: 18px 0 7px;
  color: #514a41;
  font-size: 24px;
}

.notificationModal__dialog time {
  color: #a39a90;
  font-size: 13px;
}

.notificationModal__dialog p {
  margin: 24px 0;
  color: #6f675e;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.notificationModal__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.notificationModal__link,
.notificationModal__actionClose {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #9d7636;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  border: 1px solid #cdbb9d;
  border-radius: 999px;
}

.notificationModal__link[hidden] {
  display: none;
}

.notificationModal__link:hover,
.notificationModal__link:focus-visible {
  color: #fff;
  background: #9d7636;
  outline: none;
}

.notificationModal__actionClose {
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: #4e4a45;
  border: 1px solid #4e4a45;
  border-radius: 999px;
}

.notificationModal__actionClose:hover,
.notificationModal__actionClose:focus-visible {
  background: #24211e;
  border-color: #24211e;
  outline: none;
}

body.notificationModalOpen {
  overflow: hidden;
}

.notificationsState {
  padding: 50px 20px;
  color: #92877a;
  text-align: center;
}

.notificationsState--error {
  color: #a85b55;
}

@media (max-width: 640px) {
  body[p="notifications"] .SettingMain .setting {
    padding: 20px 15px;
  }

  .notificationsHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  .notificationCard__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .notificationModal {
    padding: 15px;
  }

  .notificationModal__dialog {
    padding: 24px 20px;
  }
}
