/* 公告滚动条样式 */
.announcement-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9998;
    overflow: hidden;
    font-size: 14px;
}

.announcement-bar-inner {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: scroll-left 30s linear infinite;
}

/* 当公告内容较少时，减慢滚动速度 */
.announcement-bar-inner.slow {
    animation-duration: 20s;
}

/* 当只有一条公告时，暂停滚动并居中显示 */
.announcement-bar-inner.single {
    animation: none;
    justify-content: center;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.announcement-item-scroll {
    display: inline-flex;
    align-items: center;
    padding: 0 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.announcement-item-scroll:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.announcement-item-scroll:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    animation: underline 0.3s ease;
}

@keyframes underline {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

.announcement-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

.announcement-text {
    font-weight: 500;
}

.announcement-separator {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 20px;
}

/* 关闭按钮 */
.announcement-close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s;
}

.announcement-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .announcement-bar {
        padding: 10px 0;
        font-size: 13px;
    }
    
    .announcement-item-scroll {
        padding: 0 20px;
    }
    
    .announcement-separator {
        margin: 0 10px;
    }
}

/* 当有浮动按钮时，为公告栏留出空间 */
body.has-announcement #floatingButtonsContainer {
    bottom: 60px !important;
}

/* 暂停动画（鼠标悬停时） */
.announcement-bar:hover .announcement-bar-inner {
    animation-play-state: paused;
}

/* 渐变遮罩效果 */
.announcement-bar::before,
.announcement-bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    pointer-events: none;
    z-index: 1;
}

.announcement-bar::before {
    left: 0;
    background: linear-gradient(to right, rgba(102, 126, 234, 1), rgba(102, 126, 234, 0));
}

.announcement-bar::after {
    right: 0;
    background: linear-gradient(to left, rgba(118, 75, 162, 1), rgba(118, 75, 162, 0));
}

/* 隐藏状态 */
.announcement-bar.hidden {
    display: none;
}

/* Markdown 内容样式 */
.announcement-modal-content {
    padding: 20px;
    line-height: 1.8;
    color: #333;
    font-size: 15px;
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-word;
    -webkit-overflow-scrolling: touch;
    min-height: 200px;
}

.announcement-modal-content h1,
.announcement-modal-content h2,
.announcement-modal-content h3,
.announcement-modal-content h4,
.announcement-modal-content h5,
.announcement-modal-content h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: #667eea;
}

.announcement-modal-content h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.3em;
}

.announcement-modal-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3em;
}

.announcement-modal-content h3 {
    font-size: 1.3em;
}

.announcement-modal-content h4 {
    font-size: 1.1em;
}

.announcement-modal-content p {
    margin-bottom: 1em;
}

.announcement-modal-content ul,
.announcement-modal-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.announcement-modal-content li {
    margin-bottom: 0.3em;
}

.announcement-modal-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.announcement-modal-content pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
    border-left: 4px solid #667eea;
}

.announcement-modal-content pre code {
    background: transparent;
    padding: 0;
    color: #333;
}

.announcement-modal-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1em;
    margin: 1em 0;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    padding: 0.5em 1em;
    border-radius: 4px;
}

.announcement-modal-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.announcement-modal-content a:hover {
    border-bottom-color: #667eea;
}

.announcement-modal-content strong {
    font-weight: bold;
    color: #333;
}

.announcement-modal-content em {
    font-style: italic;
}

.announcement-modal-content hr {
    border: none;
    border-top: 2px solid #ddd;
    margin: 1.5em 0;
}

.announcement-modal-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.announcement-modal-content table th,
.announcement-modal-content table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.announcement-modal-content table th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.announcement-modal-content table tr:nth-child(even) {
    background: #f9f9f9;
}

.announcement-modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1em 0;
}

/* 弹窗主体容器 */
.announcement-modal-body {
    background: white;
    border-radius: 0 0 12px 12px;
}

/* 编辑预览区域的内容样式 */
#previewArea .announcement-modal-content {
    background: white;
    border-radius: 6px;
    margin: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .announcement-modal-content {
        padding: 16px;
        font-size: 14px;
    }
    
    .announcement-modal-content h1 {
        font-size: 1.5em;
    }
    
    .announcement-modal-content h2 {
        font-size: 1.3em;
    }
    
    .announcement-modal-content h3 {
        font-size: 1.1em;
    }
    
    .announcement-modal-content pre {
        padding: 8px;
        font-size: 0.85em;
    }
    
    .announcement-modal-content table {
        font-size: 0.9em;
    }
    
    .announcement-modal-content table th,
    .announcement-modal-content table td {
        padding: 6px 8px;
    }
}

/* 脚注样式 */
.announcement-modal-content .footnotes {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9em;
    color: #64748b;
}

.announcement-modal-content .footnotes ol {
    padding-left: 1.5em;
}

.announcement-modal-content .footnotes li {
    margin-bottom: 0.5em;
}

.announcement-modal-content sup {
    vertical-align: super;
    font-size: 0.75em;
}

.announcement-modal-content sup a {
    text-decoration: none;
    color: #667eea;
    font-weight: bold;
    padding: 0 2px;
}

.announcement-modal-content sup a:hover {
    text-decoration: underline;
}

/* Markdown 编辑器预览区域的脚注样式 */
.markdown-preview-content .footnotes {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9em;
    color: #64748b;
}

.markdown-preview-content .footnotes ol {
    padding-left: 1.5em;
}

.markdown-preview-content .footnotes li {
    margin-bottom: 0.5em;
}

.markdown-preview-content sup {
    vertical-align: super;
    font-size: 0.75em;
}

.markdown-preview-content sup a {
    text-decoration: none;
    color: #667eea;
    font-weight: bold;
    padding: 0 2px;
}

.markdown-preview-content sup a:hover {
    text-decoration: underline;
}

