* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  min-height: 100vh;
  color: #e0e0e0;
  overflow-x: hidden;
}

/* ========== 演示面板 ========== */

.demo-panel {
  max-width: 720px;
  margin: 40px auto;
  padding: 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-panel h1 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  text-align: center;
  color: #9ca3af;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.button-group {
  margin-bottom: 24px;
}

.button-group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9ca3af;
  margin-bottom: 12px;
  padding-left: 4px;
}

.button-group button {
  display: inline-block;
  padding: 10px 18px;
  margin: 4px;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
  opacity: 0.85;
}

.button-group button:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.button-group button:active {
  transform: translateY(0);
}

/* 按钮颜色 */
.button-group:nth-child(2) button { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.button-group:nth-child(3) button { background: linear-gradient(135deg, #22c55e, #16a34a); }
.button-group:nth-child(4) button { background: linear-gradient(135deg, #f59e0b, #d97706); }
.button-group:nth-child(5) button { background: linear-gradient(135deg, #ef4444, #dc2626); }

.btn-burst {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
}

.btn-clear {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
}

/* ========== 通知容器 ========== */

#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  max-height: calc(100vh - 40px);
  overflow: visible;
  z-index: 9999;
  pointer-events: none;
}

/* ========== 通知卡片 ========== */

.notification {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 340px;
  max-width: 420px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(30, 30, 40, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  user-select: none;

  /* 默认状态：在屏幕右侧外 */
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              margin-bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 滑入动画 */
.notification.show {
  transform: translateX(0);
  opacity: 1;
}

/* 滑出动画 */
.notification.hide {
  transform: translateX(120%);
  opacity: 0;
  margin-bottom: -80px;
}

/* 左侧彩色条 */
.notification::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

/* 底部进度条 */
.notification::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  transform-origin: left;
  animation: progress-shrink linear forwards;
}

@keyframes progress-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ========== 类型颜色 ========== */

.notification.info::before    { background: #3b82f6; }
.notification.success::before { background: #22c55e; }
.notification.warning::before { background: #f59e0b; }
.notification.error::before   { background: #ef4444; }

.notification.info::after    { background: #3b82f6; }
.notification.success::after { background: #22c55e; }
.notification.warning::after { background: #f59e0b; }
.notification.error::after   { background: #ef4444; }

/* 图标颜色 */
.notification .icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.notification.info .icon    { color: #60a5fa; }
.notification.success .icon { color: #4ade80; }
.notification.warning .icon { color: #fbbf24; }
.notification.error .icon   { color: #f87171; }

/* ========== 通知内容 ========== */

.notification .content {
  flex: 1;
  min-width: 0;
}

.notification .title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f3f4f6;
  margin-bottom: 4px;
}

.notification .message {
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.5;
}

/* 优先级标签 */
.notification .priority-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

.notification .priority-badge.low    { background: rgba(107, 114, 128, 0.3); color: #9ca3af; }
.notification .priority-badge.medium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.notification .priority-badge.high   { background: rgba(239, 68, 68, 0.2);  color: #f87171; }

/* 关闭按钮 */
.notification .close-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #6b7280;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.notification .close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
}

/* 高优先级通知强调 */
.notification.high-priority {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(239, 68, 68, 0.1);
  animation: high-priority-pulse 2s ease-in-out infinite;
}

@keyframes high-priority-pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(239, 68, 68, 0.1); }
  50%      { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(239, 68, 68, 0.2); }
}

/* ========== 响应式 ========== */

@media (max-width: 480px) {
  .notification {
    min-width: 280px;
    max-width: calc(100vw - 40px);
  }

  #notification-container {
    right: 10px;
    top: 10px;
    gap: 8px;
  }

  .demo-panel {
    margin: 20px;
    padding: 24px;
  }
}
