/* 公告系统样式 */

.announcement-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: fadeIn 0.3s ease-out;
}

.announcement-modal.is-open {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.announcement-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.announcement-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.announcement-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}

.announcement-close-btn:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.announcement-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.announcement-item {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  background: #ffffff;
}

.announcement-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.announcement-item-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.announcement-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.announcement-item-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  line-height: 1.5;
  margin: 0;
}

.announcement-item-content {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px 52px;
  white-space: pre-wrap;
}

.announcement-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: 52px;
  font-size: 12px;
  color: #9ca3af;
}

.announcement-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* 公告类型样式 */
.announcement-type-update .announcement-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.announcement-type-update {
  border-color: #3b82f6;
}

.announcement-type-update .announcement-type-badge {
  background: #dbeafe;
  color: #1e40af;
}

.announcement-type-bugfix .announcement-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.announcement-type-bugfix {
  border-color: #10b981;
}

.announcement-type-bugfix .announcement-type-badge {
  background: #d1fae5;
  color: #065f46;
}

.announcement-type-notice .announcement-icon {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

.announcement-type-notice {
  border-color: #9ca3af;
}

.announcement-type-notice .announcement-type-badge {
  background: #f3f4f6;
  color: #374151;
}

.announcement-type-warning .announcement-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.announcement-type-warning {
  border-color: #f59e0b;
}

.announcement-type-warning .announcement-type-badge {
  background: #fef3c7;
  color: #92400e;
}

.announcement-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.announcement-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
}

.announcement-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.announcement-btn-secondary:hover {
  background: #e5e7eb;
}

.announcement-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.announcement-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.announcement-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.announcement-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.announcement-empty-text {
  font-size: 16px;
  color: #6b7280;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .announcement-modal {
    padding: 0;
  }

  .announcement-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100vh;
  }

  .announcement-header {
    padding: 20px 16px 12px;
  }

  .announcement-header h2 {
    font-size: 18px;
  }

  .announcement-body {
    padding: 16px;
  }

  .announcement-item {
    padding: 14px;
  }

  .announcement-item-content {
    margin-left: 0;
    margin-top: 8px;
  }

  .announcement-item-footer {
    margin-left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .announcement-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
  }

  .announcement-btn {
    width: 100%;
    padding: 12px 20px;
  }
}

/* 滚动条样式 */
.announcement-body::-webkit-scrollbar {
  width: 8px;
}

.announcement-body::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.announcement-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.announcement-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* 加载状态 */
.announcement-loading {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.announcement-loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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