:host {
  display: block;
}

.hb-notification {
  display: flex;
  align-items: flex-start;
  gap: var(--hb-spacing-sm);
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: var(--hb-spacing-md) var(--hb-spacing-lg);
  background-color: var(--hb-color-bg-elevated);
  border-radius: var(--hb-border-radius-base);
  box-shadow: var(--hb-box-shadow-lg);
  border-left: 4px solid var(--hb-color-primary);
  font-size: var(--hb-font-size-sm);
  color: var(--hb-color-text);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(0);
  transition: opacity 0.3s, transform 0.3s;
}

.hb-notification--visible {
  opacity: 1;
}

.hb-notification--top-right,
.hb-notification--bottom-right {
  transform: translateX(24px);
}
.hb-notification--top-right.hb-notification--visible,
.hb-notification--bottom-right.hb-notification--visible {
  transform: translateX(0);
}

.hb-notification--top-left,
.hb-notification--bottom-left {
  transform: translateX(-24px);
}
.hb-notification--top-left.hb-notification--visible,
.hb-notification--bottom-left.hb-notification--visible {
  transform: translateX(0);
}

/* 类型边框色 */
.hb-notification--success { border-left-color: var(--hb-color-success); }
.hb-notification--warning { border-left-color: var(--hb-color-warning); }
.hb-notification--error   { border-left-color: var(--hb-color-danger); }
.hb-notification--info    { border-left-color: var(--hb-color-primary); }

.hb-notification__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

/* 用纯 CSS 形态表示图标，避免依赖 hb-icon */
.hb-notification__icon-sign {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: relative;
}
.hb-notification__icon-sign::after {
  content: '';
  position: absolute;
  inset: 0;
}
.hb-notification__icon-sign--success {
  background-color: var(--hb-color-success);
}
.hb-notification__icon-sign--success::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  inset: auto 0 0 0;
}
.hb-notification__icon-sign--warning {
  background-color: var(--hb-color-warning);
}
.hb-notification__icon-sign--warning::after {
  content: '!';
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  inset: auto 0 0 0;
}
.hb-notification__icon-sign--error {
  background-color: var(--hb-color-danger);
}
.hb-notification__icon-sign--error::after {
  content: '✕';
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  inset: auto 0 0 0;
}
.hb-notification__icon-sign--info {
  background-color: var(--hb-color-primary);
}
.hb-notification__icon-sign--info::after {
  content: 'i';
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  font-style: italic;
  font-weight: bold;
  inset: auto 0 0 0;
}

.hb-notification__content {
  flex: 1;
  min-width: 0;
}

.hb-notification__title {
  font-size: var(--hb-font-size-base);
  font-weight: 600;
  color: var(--hb-color-text-primary);
  margin-bottom: var(--hb-spacing-xxs);
  line-height: 1.4;
}

.hb-notification__message {
  color: var(--hb-color-text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.hb-notification__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: var(--hb-spacing-xs);
  cursor: pointer;
  font-size: 16px;
  color: var(--hb-color-text-tertiary);
  border: none;
  background: transparent;
  border-radius: 50%;
  transition: background-color var(--hb-transition-duration), color var(--hb-transition-duration);
}
.hb-notification__close:hover {
  background-color: var(--hb-color-fill-tertiary);
  color: var(--hb-color-text-secondary);
}
