/* 公告弹窗样式 - 与网站UI风格统一 */

/* 遮罩层 */
.announcement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 6, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.announcement-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* 弹窗主体 */
.announcement-modal {
    background: linear-gradient(145deg, #1a1025 0%, #0d0618 100%);
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.announcement-modal.shake {
    animation: shake 0.5s ease;
}

/* 头部 */
.announcement-header {
    padding: 24px 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    flex: 1;
    line-height: 1.4;
}

/* 公告类型标识 */
.announcement-badge {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* 访问公告样式 - 蓝色主题 */
.announcement-visitor .announcement-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #357abd);
}

.announcement-visitor .announcement-modal {
    position: relative;
}

.announcement-visitor .announcement-btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
}

.announcement-visitor .announcement-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a9fe8 0%, #4088c7 100%);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

/* 内部公告样式 - 紫色主题 */
.announcement-internal .announcement-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.announcement-internal .announcement-modal {
    position: relative;
}

.announcement-internal .announcement-btn-primary {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.announcement-internal .announcement-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #a66bbe 0%, #9b59b6 100%);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.4);
}

/* 内容区域 */
.announcement-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
}

/* 纯文本内容样式 */
.announcement-content.text-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* HTML内容样式 */
.announcement-content.html-content h1,
.announcement-content.html-content h2,
.announcement-content.html-content h3,
.announcement-content.html-content h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #fff;
}

.announcement-content.html-content p {
    margin-bottom: 12px;
}

.announcement-content.html-content ul,
.announcement-content.html-content ol {
    margin-bottom: 12px;
    padding-left: 20px;
}

.announcement-content.html-content a {
    color: #f97316;
    text-decoration: none;
    transition: color 0.2s;
}

.announcement-content.html-content a:hover {
    color: #fb923c;
    text-decoration: underline;
}

.announcement-content.html-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
}

.announcement-content.html-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.announcement-content.html-content th,
.announcement-content.html-content td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    text-align: left;
}

.announcement-content.html-content th {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.announcement-content.html-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

.announcement-content.html-content blockquote {
    border-left: 3px solid #f97316;
    padding-left: 16px;
    margin: 12px 0;
    color: rgba(255, 255, 255, 0.7);
}

/* 底部按钮区域 */
.announcement-footer {
    padding: 20px 24px 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 160px;
}

.announcement-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.announcement-btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.announcement-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.announcement-btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

/* 禁用页面滚动 */
body.announcement-open {
    overflow: hidden;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* 滚动条样式 */
.announcement-content::-webkit-scrollbar {
    width: 6px;
}

.announcement-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.announcement-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.announcement-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .announcement-overlay {
        padding: 16px;
        align-items: flex-end;
    }
    
    .announcement-modal {
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        max-width: 100%;
    }
    
    .announcement-header {
        padding: 20px 20px 16px;
    }
    
    .announcement-header h3 {
        font-size: 18px;
    }
    
    .announcement-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .announcement-content {
        padding: 20px;
        font-size: 14px;
    }
    
    .announcement-footer {
        padding: 16px 20px 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    }
    
    .announcement-btn {
        width: 100%;
        padding: 16px 24px;
    }
}

/* 小屏幕手机 */
@media (max-width: 375px) {
    .announcement-header h3 {
        font-size: 16px;
    }
    
    .announcement-content {
        font-size: 13px;
        line-height: 1.7;
    }
}
