.notification-page-content {
  display: grid;
  gap: 16px;
  align-content: start;
}

.notification-state-note {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  color: #78350f;
  font-size: 12px;
  line-height: 1.55;
}

.notification-state-note strong { margin-right: 6px; }

.notification-unread-summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.notification-unread-summary.is-clear {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.notification-filter-row { display: flex; align-items: stretch; gap: 12px; }
.notification-filter-row .notification-tabs { flex: 1; min-width: 0; }
.filter-dim-label {
  flex: none;
  align-self: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: .2px;
  white-space: nowrap;
}

.notification-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.notification-tab {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.notification-tab:hover { color: var(--text); }
.notification-tab:focus-visible { outline: 3px solid rgba(15, 118, 110, .18); outline-offset: -3px; }
.notification-tab.active { border-bottom-color: var(--brand); color: var(--brand); }
.notification-tab span {
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}
.notification-tab.active span { background: #e8f7f4; color: var(--brand); }

/* 用户侧二级筛选：业务类型 chip + 只看未读（层级弱于一级来源 Tab） */
.notification-subfilters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0 2px;
}
.type-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.notification-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.notification-type-chip span {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
}
.notification-type-chip:hover { color: var(--text); border-color: var(--brand); }
.notification-type-chip:focus-visible { outline: 3px solid rgba(15, 118, 110, .18); outline-offset: 1px; }
.notification-type-chip.active { background: #e8f7f4; border-color: var(--brand); color: var(--brand); }
.notification-type-chip.active span { color: var(--brand); }
.unread-only-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.unread-only-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.unread-only-toggle:hover { color: var(--text); }
/* 作者样式 display:flex 会覆盖 hidden 的默认隐藏，需显式兜底 */
.notification-subfilters[hidden],
.type-chip-row[hidden] { display: none !important; }

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  position: relative;
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.notification-item.critical { border-left-color: #dc2626; }
.notification-item.warning { border-left-color: #f59e0b; }
.notification-item.success { border-left-color: #10b981; }
.notification-item.info { border-left-color: #3b82f6; }
.notification-item.lifecycle-revoked { border-left-color: #98a2b3; background: #f8fafc; }
.notification-item.unread { background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.notification-item.read { background: #f8fafc; }

.notification-open {
  min-width: 0;
  align-self: stretch;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.notification-open:hover { background: rgba(15, 118, 110, .035); }
.notification-open:focus-visible { outline: 3px solid rgba(15, 118, 110, .18); outline-offset: -3px; }

.notification-type-icon,
.channel-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f7f4;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.notification-copy { min-width: 0; display: grid; gap: 6px; }
.notification-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.notification-title-cluster { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.notification-state-cluster { flex: 0 0 auto; display: grid; justify-items: end; gap: 6px; }
.notification-state-cluster time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.notification-title { color: var(--text); font-size: 14px; font-weight: 650; }
.notification-item.unread .notification-title { font-weight: 850; }
.notification-body { color: #475467; font-size: 13px; line-height: 1.55; }
.notification-meta { display: flex; gap: 12px; color: var(--muted); font-size: 11px; }

.level-badge,
.notification-lifecycle-badge,
.unread-label {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.level-badge.critical { background: #fee2e2; color: #b91c1c; }
.level-badge.warning { background: #fef3c7; color: #92400e; }
.level-badge.success { background: #d1fae5; color: #047857; }
.level-badge.info { background: #dbeafe; color: #1d4ed8; }
.notification-source-badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
}
.notification-source-badge.auto { background: #eef2f6; color: #475467; border-color: #d0d5dd; }
.notification-source-badge.manual { background: #f4eefb; color: #7352a3; border-color: #d9cbee; }
.notification-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.notification-lifecycle-badge.published { background: #e8f7f4; color: #0f766e; }
.notification-lifecycle-badge.updated { background: #e0f2fe; color: #0369a1; }
.notification-lifecycle-badge.revoked { background: #e4e7ec; color: #475467; }
.unread-label { background: #e8f7f4; color: var(--brand); }
.read-state-label {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.read-state-label::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.read-state-label.unread { border-color: #f0b8b4; background: #fff1f0; color: #c73b35; }
.read-state-label.read { border-color: #cbd5df; background: #f4f6f8; color: #667085; }

.notification-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .46);
}
.notification-modal-mask.open { display: grid; }
.notification-modal {
  width: min(560px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}
.notification-modal:focus { outline: none; }
.notification-modal-head,
.notification-modal-foot {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
}
.notification-modal-head { border-bottom: 1px solid var(--line); }
.notification-modal-head > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.notification-modal-head h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.notification-modal-body { padding: 20px 18px; display: grid; gap: 20px; }
.notification-modal-body p { margin: 0; color: #344054; font-size: 14px; line-height: 1.7; }
.notification-modal-body dl { margin: 0; display: grid; gap: 10px; }
.notification-modal-body dl div { display: flex; justify-content: space-between; gap: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.notification-modal-body dt { color: var(--muted); }
.notification-modal-body dd { margin: 0; color: var(--text); font-weight: 750; text-align: right; }
.notification-modal-foot { justify-content: flex-end; border-top: 1px solid var(--line); }

.notification-settings-placeholder { max-width: 760px; }
.default-channel-grid { padding: 18px; display: grid; gap: 10px; }
.default-channel-grid > div { min-height: 68px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.default-channel-grid > div > span:nth-child(2) { display: grid; gap: 3px; }
.default-channel-grid small { color: var(--muted); }
.settings-note { margin: 0 18px 16px; color: var(--muted); line-height: 1.6; }
.notification-settings-placeholder .btn.primary { margin: 0 18px 18px; }

@media (max-width: 768px) {
  .notification-page-content { padding-inline: 12px; }
  .notification-item { grid-template-columns: 1fr; gap: 0; }
  .notification-open { grid-template-columns: 34px minmax(0, 1fr); padding: 13px 12px; }
  .notification-type-icon { width: 34px; height: 34px; }
  .notification-modal-mask { padding: 10px; }
  .notification-modal-head { align-items: flex-start; }
  .notification-modal-head > div { align-items: flex-start; flex-direction: column; }
  .default-channel-grid > div { grid-template-columns: 36px minmax(0, 1fr); }
  .default-channel-grid .status { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-open, .notification-tab { transition: none; }
}

/* 告警卡片“去处理”入口行：仅提供跳转对应业务页面的按钮，不在通知内流转处理状态 */
.notification-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 14px 68px;
  margin-top: -4px;
}
.notification-action-row .btn.compact { padding: 5px 12px; font-size: 12px; }
