/**
 * ============================================
 * 公告通知组件样式
 * 适用于所有页面的全局公告按钮和弹窗
 * ============================================
 */

/* 导航栏公告按钮 */
.announcement-btn-nav {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d68f 0%, #00b374 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 214, 143, 0.35);
    margin-right: 12px;
    flex-shrink: 0;
}

.announcement-btn-nav:hover {
    background: linear-gradient(135deg, #00e69c 0%, #00c783 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 214, 143, 0.45);
}

.announcement-btn-nav:active {
    transform: scale(0.95);
}

.announcement-btn-nav svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* 导航栏按钮角标 */
.announcement-btn-nav .announcement-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
    border: 2px solid #fff;
}

/* 旧版浮动公告按钮（保留兼容性） */
.announcement-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d68f 0%, #00b374 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    box-shadow: 
        0 4px 15px rgba(0, 214, 143, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    user-select: none;
    touch-action: none;
}

.announcement-btn:hover {
    background: linear-gradient(135deg, #00e69c 0%, #00c783 100%);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 214, 143, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.announcement-btn:active {
    transform: scale(0.95);
    box-shadow: 
        0 2px 8px rgba(0, 214, 143, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.announcement-btn.dragging {
    cursor: grabbing;
    transform: scale(1.12);
    box-shadow: 
        0 12px 35px rgba(0, 214, 143, 0.6),
        0 6px 15px rgba(0, 0, 0, 0.3);
    transition: none;
}

.announcement-btn svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* 公告角标 */
.announcement-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 3px 8px rgba(255, 77, 79, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
    border: 2px solid #fff;
}

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

/* 弹窗遮罩 */
.announcement-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.announcement-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 公告弹窗 - 浅色系 */
.announcement-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.announcement-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗头部 - 浅色系 */
.announcement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    border-radius: 12px 12px 0 0;
}

.announcement-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #262626;
}

.announcement-modal-title svg {
    color: #00d68f;
}

.announcement-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.announcement-modal-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    background: #ffffff;
    color: #595959;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.25s ease;
}

.announcement-modal-btn:hover {
    background: #f5f5f5;
    border-color: #bfbfbf;
    color: #262626;
}

.announcement-modal-btn.primary {
    background: linear-gradient(135deg, #00d68f 0%, #00b374 100%);
    border-color: #00d68f;
    color: #ffffff;
    font-weight: 500;
}

.announcement-modal-btn.primary:hover {
    background: linear-gradient(135deg, #00e699 0%, #00d68f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 214, 143, 0.3);
}

/* 弹窗内容区域 - 浅色系 */
.announcement-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    max-height: 50vh;
    background: #fafafa;
}

.announcement-modal-body::-webkit-scrollbar {
    width: 6px;
}

.announcement-modal-body::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.announcement-modal-body::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

.announcement-modal-body::-webkit-scrollbar-thumb:hover {
    background: #bfbfbf;
}

/* 公告条目 - 浅色系 */
.announcement-item {
    padding: 16px;
    margin-bottom: 12px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.25s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.announcement-item:hover {
    border-color: #d9d9d9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

.announcement-item.unread {
    background: linear-gradient(135deg, rgba(0, 214, 143, 0.05) 0%, #ffffff 100%);
    border-left: 3px solid #00d68f;
}

.announcement-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.announcement-item-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.announcement-item-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.announcement-item-badge.update {
    background: rgba(0, 214, 143, 0.1);
    color: #00b374;
}

.announcement-item-badge.feature {
    background: rgba(24, 144, 255, 0.1);
    color: #1890ff;
}

.announcement-item-badge.tip {
    background: rgba(250, 173, 20, 0.1);
    color: #faad14;
}

.announcement-item-badge.default {
    background: rgba(0, 0, 0, 0.06);
    color: #8c8c8c;
}

.announcement-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    margin: 0;
}

.announcement-item-new {
    padding: 1px 6px;
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    animation: newBadgePulse 1.5s ease-in-out infinite;
}

@keyframes newBadgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.announcement-item-date {
    font-size: 12px;
    color: #8c8c8c;
    white-space: nowrap;
}

.announcement-item-content {
    font-size: 13px;
    color: #595959;
    line-height: 1.7;
}

.announcement-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8c8c8c;
    font-size: 14px;
}

/* 加载状态 - 浅色系 */
.announcement-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #8c8c8c;
    font-size: 14px;
}

.announcement-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top-color: #00d68f;
    border-radius: 50%;
    animation: announcementSpin 1s linear infinite;
    margin-right: 10px;
}

@keyframes announcementSpin {
    to { transform: rotate(360deg); }
}

/* 弹窗底部 - 浅色系 */
.announcement-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.announcement-modal-footer-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #00d68f 0%, #00b374 100%);
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.announcement-modal-footer-btn:hover {
    background: linear-gradient(135deg, #00e699 0%, #00d68f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 214, 143, 0.35);
}

/* 响应式适配 */
@media (max-width: 640px) {
    .announcement-btn {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
    
    .announcement-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .announcement-badge {
        min-width: 18px;
        height: 18px;
        font-size: 11px;
        top: -3px;
        right: -3px;
    }

    .announcement-modal {
        width: 95%;
        max-height: 85vh;
    }

    .announcement-modal-header {
        padding: 16px 20px;
    }

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

    .announcement-modal-btn span {
        display: none;
    }

    .announcement-modal-body {
        padding: 12px 16px;
    }

    .announcement-item {
        padding: 12px;
    }

    .announcement-item-title {
        font-size: 13px;
    }

    .announcement-item-content {
        font-size: 12px;
    }
}
