/**
 * 滚动广告横幅样式
 */

/* 广告横幅容器 */
.announcement-banner {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 768px) {
  .announcement-banner {
    padding: 14px 20px;
    margin-bottom: 24px;
  }
}

/* 背景装饰 */
.announcement-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

/* 滚动容器 */
.announcement-scroll {
  position: relative;
  overflow: hidden;
  height: 24px;
  display: flex;
  align-items: center;
}

@media (min-width: 768px) {
  .announcement-scroll {
    height: 28px;
  }
}

/* 图标 */
.announcement-icon {
  position: relative;
  z-index: 1;
  font-size: 18px;
  margin-right: 12px;
  flex-shrink: 0;
  animation: ring 2s ease-in-out infinite;
}

@media (min-width: 768px) {
  .announcement-icon {
    font-size: 20px;
    margin-right: 16px;
  }
}

@keyframes ring {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
  50% { transform: rotate(0deg); }
}

/* 滚动内容 */
.announcement-content {
  position: relative;
  z-index: 1;
  display: flex;
  white-space: nowrap;
  animation: scroll-left 30s linear infinite;
}

.announcement-content:hover {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* 公告项 */
.announcement-item {
  display: inline-flex;
  align-items: center;
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding-right: 60px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .announcement-item {
    font-size: 15px;
    padding-right: 80px;
  }
}

.announcement-item::before {
  content: '•';
  margin: 0 12px;
  font-size: 12px;
  opacity: 0.6;
}

.announcement-item:first-child::before {
  display: none;
}

/* 标签 */
.announcement-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .announcement-tag {
    padding: 3px 10px;
    font-size: 12px;
  }
}

.announcement-tag.hot {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  animation: pulse-tag 2s ease-in-out infinite;
}

.announcement-tag.new {
  background: linear-gradient(135deg, #51cf66, #37b24d);
}

@keyframes pulse-tag {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0);
  }
}

/* 关闭按钮 */
.announcement-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
}

@media (min-width: 768px) {
  .announcement-close {
    right: 16px;
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

.announcement-close:hover {
  background: rgba(255, 255, 255, 0.3);
  opacity: 1;
  transform: translateY(-50%) rotate(90deg);
}

.announcement-close:active {
  transform: translateY(-50%) scale(0.9);
}

/* 隐藏状态 */
.announcement-banner.hidden {
  display: none;
}

/* 紧凑模式（用于小屏幕） */
@media (max-width: 480px) {
  .announcement-banner {
    padding: 10px 12px;
  }
  
  .announcement-icon {
    font-size: 16px;
    margin-right: 8px;
  }
  
  .announcement-item {
    font-size: 13px;
    padding-right: 40px;
  }
  
  .announcement-tag {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* 多条公告样式 */
.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .announcement-list {
    gap: 16px;
    margin-bottom: 24px;
  }
}

/* 静态公告（不滚动） */
.announcement-static {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (min-width: 768px) {
  .announcement-static {
    padding: 18px 24px;
    margin-bottom: 24px;
  }
}

.announcement-static .announcement-icon {
  font-size: 24px;
  margin: 0;
  animation: none;
}

@media (min-width: 768px) {
  .announcement-static .announcement-icon {
    font-size: 28px;
  }
}

.announcement-static .announcement-text {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .announcement-static .announcement-text {
    font-size: 15px;
  }
}

.announcement-static .announcement-text strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* 渐变文字效果 */
.announcement-gradient-text {
  background: linear-gradient(90deg, #fff, #f0f0f0, #fff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}
