/* 公告弹窗样式 - Announcement Modal Styles */
/* 现代化设计，支持多端响应式 */

/* 遮罩层 */
.announcement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement-overlay.active {
    display: block;
    opacity: 1;
}

/* 弹窗容器 */
.announcement-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 92%;
    max-width: 520px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 
        0 25px 80px rgba(15, 23, 42, 0.25),
        0 10px 30px rgba(15, 23, 42, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.8, 0.64, 1);
    overflow: hidden;
}

.announcement-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗头部 - 使用深色主题替代蓝紫渐变 */
.announcement-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    color: #ffffff;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.announcement-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.announcement-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.announcement-title i {
    font-size: 20px;
    color: #fbbf24;
    filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.3));
}

.announcement-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.announcement-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.announcement-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* 弹窗内容区 */
.announcement-body {
    padding: 28px;
    max-height: calc(88vh - 160px);
    overflow-y: auto;
    background: #ffffff;
    scroll-behavior: smooth;
}

/* 公告图标 */
.announcement-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fcd34d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 
        0 8px 25px rgba(251, 191, 36, 0.25),
        0 4px 10px rgba(251, 191, 36, 0.15);
    animation: iconPulse 2s ease-in-out infinite;
}

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

.announcement-icon i {
    font-size: 32px;
    color: #d97706;
}

/* 公告内容 - 支持HTML格式和纯文本换行 */
.announcement-content {
    font-size: 15px;
    line-height: 1.85;
    color: #374151;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.announcement-content p {
    margin: 0 0 14px 0;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.announcement-content p:last-child {
    margin-bottom: 0;
}

.announcement-content a {
    color: #059669;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.announcement-content a:hover {
    border-bottom-color: #059669;
    color: #047857;
}

.announcement-content strong,
.announcement-content b {
    color: #111827;
    font-weight: 600;
}

.announcement-content h1,
.announcement-content h2,
.announcement-content h3,
.announcement-content h4 {
    color: #111827;
    margin: 24px 0 14px 0;
    font-weight: 600;
    line-height: 1.4;
}

.announcement-content h1 {
    font-size: 22px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.announcement-content h2 {
    font-size: 19px;
}

.announcement-content h3 {
    font-size: 17px;
}

.announcement-content h4 {
    font-size: 15px;
    color: #4b5563;
}

.announcement-content ul,
.announcement-content ol {
    margin: 14px 0;
    padding-left: 26px;
}

.announcement-content li {
    margin: 8px 0;
    position: relative;
}

.announcement-content ul li::marker {
    color: #059669;
}

.announcement-content code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #dc2626;
    border: 1px solid #e5e7eb;
}

.announcement-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 18px;
    border-radius: 10px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    margin: 16px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.announcement-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

.announcement-content blockquote {
    border-left: 4px solid #fbbf24;
    margin: 18px 0;
    padding: 14px 18px;
    background: linear-gradient(90deg, #fffbeb 0%, #ffffff 100%);
    border-radius: 0 10px 10px 0;
    color: #92400e;
}

.announcement-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}

.announcement-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 14px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.announcement-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.announcement-content th,
.announcement-content td {
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.announcement-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

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

.announcement-content tr:hover {
    background: #f3f4f6;
}

/* 弹窗底部 */
.announcement-footer {
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    border-top: 1px solid #e5e7eb;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.announcement-dont-show {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.announcement-dont-show:hover {
    color: #4b5563;
}

.announcement-dont-show input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #059669;
    cursor: pointer;
    margin: 0;
    border-radius: 4px;
}

.announcement-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
    position: relative;
    overflow: hidden;
}

.announcement-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.announcement-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
}

.announcement-btn:hover::before {
    left: 100%;
}

.announcement-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

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

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

.announcement-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    border: 2px solid #f1f5f9;
}

.announcement-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 768px) {
    .announcement-modal {
        width: 94%;
        max-width: 480px;
        max-height: 85vh;
        border-radius: 16px;
    }

    .announcement-header {
        padding: 18px 22px;
    }

    .announcement-title {
        font-size: 16px;
    }

    .announcement-title i {
        font-size: 18px;
    }

    .announcement-body {
        padding: 24px;
        max-height: calc(85vh - 140px);
    }

    .announcement-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
    }

    .announcement-icon i {
        font-size: 28px;
    }

    .announcement-content {
        font-size: 14px;
        line-height: 1.75;
    }

    .announcement-content h1 {
        font-size: 20px;
    }

    .announcement-content h2 {
        font-size: 17px;
    }

    .announcement-content h3 {
        font-size: 15px;
    }

    .announcement-footer {
        padding: 16px 22px;
    }

    .announcement-btn {
        padding: 11px 28px;
    }
}

/* 响应式设计 - 手机设备 */
@media (max-width: 480px) {
    .announcement-modal {
        width: 95%;
        max-height: 82vh;
        border-radius: 14px;
    }

    .announcement-header {
        padding: 16px 18px;
    }

    .announcement-title {
        font-size: 15px;
        gap: 8px;
    }

    .announcement-title i {
        font-size: 17px;
    }

    .announcement-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .announcement-body {
        padding: 20px;
        max-height: calc(82vh - 130px);
    }

    .announcement-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 18px;
    }

    .announcement-icon i {
        font-size: 24px;
    }

    .announcement-content {
        font-size: 14px;
        line-height: 1.7;
    }

    .announcement-content h1 {
        font-size: 18px;
    }

    .announcement-content h2 {
        font-size: 16px;
    }

    .announcement-content h3,
    .announcement-content h4 {
        font-size: 14px;
    }

    .announcement-content pre {
        padding: 14px;
        font-size: 12px;
    }

    .announcement-footer {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 18px;
    }

    .announcement-dont-show {
        order: 2;
        font-size: 13px;
        flex: 1 1 auto;
        justify-content: flex-start;
        white-space: nowrap;
    }

    .announcement-btn {
        order: 1;
        flex: 0 0 auto;
        padding: 11px 24px;
        font-size: 14px;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 360px) {
    .announcement-modal {
        width: 96%;
        max-height: 80vh;
        border-radius: 12px;
    }

    .announcement-header {
        padding: 14px 16px;
    }

    .announcement-title {
        font-size: 14px;
    }

    .announcement-body {
        padding: 16px;
        max-height: calc(80vh - 120px);
    }

    .announcement-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }

    .announcement-icon i {
        font-size: 20px;
    }

    .announcement-content {
        font-size: 13px;
    }

    .announcement-footer {
        padding: 14px 16px;
    }
}

/* 动画效果 */
@keyframes announcementSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

@keyframes announcementSlideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9) translateY(-20px);
    }
}

.announcement-modal.animating-in {
    animation: announcementSlideIn 0.4s cubic-bezier(0.34, 1.8, 0.64, 1) forwards;
}

.announcement-modal.animating-out {
    animation: announcementSlideOut 0.25s ease forwards;
}

/* 遮罩层动画 */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.announcement-overlay.animating-in {
    animation: overlayFadeIn 0.4s ease forwards;
}

.announcement-overlay.animating-out {
    animation: overlayFadeOut 0.25s ease forwards;
}

/* 特殊状态样式 */
.announcement-modal.important .announcement-header {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
}

.announcement-modal.important .announcement-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 50%, #fca5a5 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.25);
}

.announcement-modal.important .announcement-icon i {
    color: #dc2626;
}

.announcement-modal.success .announcement-header {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
}

.announcement-modal.success .announcement-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.25);
}

.announcement-modal.success .announcement-icon i {
    color: #059669;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    .announcement-overlay,
    .announcement-modal,
    .announcement-close,
    .announcement-btn {
        transition: none;
        animation: none;
    }

    .announcement-icon {
        animation: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .announcement-modal {
        background: #1f2937;
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.5),
            0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .announcement-body {
        background: #1f2937;
    }

    .announcement-content {
        color: #d1d5db;
    }

    .announcement-content h1,
    .announcement-content h2,
    .announcement-content h3,
    .announcement-content h4,
    .announcement-content strong,
    .announcement-content b {
        color: #f9fafb;
    }

    .announcement-content h1 {
        border-bottom-color: #374151;
    }

    .announcement-footer {
        background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
        border-top-color: #374151;
    }

    .announcement-dont-show {
        color: #9ca3af;
    }

    .announcement-body::-webkit-scrollbar-track {
        background: #374151;
    }

    .announcement-body::-webkit-scrollbar-thumb {
        background: #4b5563;
        border-color: #374151;
    }

    .announcement-body::-webkit-scrollbar-thumb:hover {
        background: #6b7280;
    }
}
