/**
 * 公告通知样式
 * 可在任意页面引入使用
 */

/* 公告通知图标 - 与用户信息按钮风格一致 */
.announcement-icon {
    position: relative;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(46, 125, 246, 0.08) 0%, rgba(107, 203, 119, 0.05) 100%);
    border: 1px solid rgba(46, 125, 246, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement-icon:hover {
    background: linear-gradient(135deg, rgba(46, 125, 246, 0.12) 0%, rgba(107, 203, 119, 0.08) 100%);
    border-color: rgba(46, 125, 246, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 125, 246, 0.15);
}

.announcement-icon:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(46, 125, 246, 0.1);
}

.announcement-icon svg {
    width: 18px;
    height: 18px;
    color: #2E7DF6;
    transition: all 0.3s ease;
}

.announcement-icon:hover svg {
    color: #1E5FC7;
    transform: scale(1.05);
}

/* 徽章样式 - 与图标风格协调 */
.announcement-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: linear-gradient(135deg, #ff4d4f 0%, #ff6b6b 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--bg-white, #fff);
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.35);
    animation: pulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 77, 79, 0.35);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 3px 10px rgba(255, 77, 79, 0.45);
    }
}

/* 公告弹窗 */
.announcement-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.announcement-modal {
    background: var(--bg-white, #fff);
    border-radius: 32px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.announcement-modal-overlay.active .announcement-modal {
    transform: scale(1);
}

.announcement-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border, #E8ECF4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.announcement-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1A1A2E);
    display: flex;
    align-items: center;
    gap: 10px;
}

.announcement-modal-title svg {
    width: 22px;
    height: 22px;
    color: #2E7DF6;
}

.announcement-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.announcement-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.announcement-modal-close svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary, #4A4A68);
}

.announcement-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-item {
    background: var(--bg-primary, #F8FAFF);
    border: 1px solid var(--border, #E8ECF4);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s ease;
}

.announcement-item:hover {
    border-color: #5B9DFE;
    box-shadow: 0 2px 8px rgba(46, 125, 246, 0.08);
}

.announcement-item.new {
    border-left: 3px solid #2E7DF6;
}

.announcement-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

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

.announcement-item-type.update {
    background: rgba(0, 214, 143, 0.15);
    color: #00d68f;
}

.announcement-item-type.feature {
    background: rgba(46, 125, 246, 0.15);
    color: #2E7DF6;
}

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

.announcement-item-type.default {
    background: rgba(138, 138, 163, 0.15);
    color: #8A8AA3;
}

.announcement-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1A1A2E);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcement-item-content {
    font-size: 13px;
    color: var(--text-secondary, #4A4A68);
    line-height: 1.6;
    margin-bottom: 10px;
}

.announcement-item-time {
    font-size: 12px;
    color: var(--text-light, #8A8AA3);
}

.new-dot {
    width: 6px;
    height: 6px;
    background: #ff4d4f;
    border-radius: 50%;
    display: inline-block;
}

.announcement-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary, #4A4A68);
}

.announcement-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-secondary, #4A4A68);
}

.announcement-loading svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

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