/**
 * Top Notice Bar Styles
 * 顶部公告栏样式
 * 
 * @package Forum_Theme
 */

/* ==========================================================================
   Top Notice Bar - 顶部公告栏
   ========================================================================== */

.top-notice-bar {
    width: 100%;
    height: 20px;
    background: #667eea;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.top-notice-inner {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: relative;
    gap: 0;
    box-sizing: border-box;
}

/* 固定的小喇叭图标 - 红色 */
.notice-icon {
    color: #ff4444;
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 10px;
    animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.15);
    }
}

/* 公告内容区域 - 左侧固定位置 */
.notice-content {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    max-width: 600px;
}

/* 公告项（支持多条垂直滚动） */
.notice-item-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(0);
    transition: none;
}

.notice-item-slide.active {
    opacity: 1;
    transform: translateY(0);
    animation: slideInUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 公告即将离开 */
.notice-item-slide.leaving {
    animation: slideOutUp 0.4s cubic-bezier(0.55, 0.06, 0.68, 0.19);
    opacity: 0;
    transform: translateY(-10px);
}

@keyframes slideOutUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.notice-text {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 有链接时显示手指 */
.notice-text[href] {
    cursor: pointer;
}

.notice-text[href]:hover {
    opacity: 0.9;
    text-decoration: underline;
}

/* 无链接时显示默认箭头 */
.notice-text:not([href]) {
    cursor: default;
}

/* ==========================================================================
   Site Header Adjustment - 调整站点头部
   ========================================================================== */

body {
    padding-top: calc(var(--header-height) + 20px); /* 加上公告栏高度 */
}

/* 导航栏默认位置：在公告栏下方 */
.site-header {
    top: 20px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .top-notice-bar {
        height: 20px;
    }
    
    body {
        padding-top: calc(var(--header-height) + 20px);
    }
    
    .site-header {
        top: 20px;
    }
    
    body.notice-hidden .site-header {
        top: 0;
    }
    
    .notice-text {
        font-size: 11px;
    }
}
    
    .top-notice-inner {
        padding: 0 15px;
    }
    
    .notice-content {
        max-width: 70%;
    }
}

@media (max-width: 480px) {
    .notice-text {
        font-size: 10px;
    }
    
    .notice-icon {
        font-size: 11px;
    }
    
    .notice-content {
        max-width: 80%;
    }
}


