/* 公告侧边栏样式 */

/* 红色角标 */
.announcement-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #ff4d4f;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* 遮罩层 */
.announcement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.announcement-overlay.show {
    display: block;
    opacity: 1;
}

/* 侧边栏 */
.announcement-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.announcement-sidebar.show {
    right: 0;
}

/* 头部 */
.announcement-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(240, 240, 240, 0.8);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
}

.announcement-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.announcement-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
    font-size: 16px;
}

.announcement-close-btn:hover {
    background: #e0e0e0;
    color: #1677ff;
}

/* 内容区域 */
.announcement-sidebar-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

/* 加载状态 */
.announcement-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(22, 119, 255, 0.1);
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #999;
}

/* 公告列表 */
.announcement-list {
    padding: 0;
}

/* 公告项 */
.announcement-item {
    border-bottom: 1px solid rgba(240, 240, 240, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.announcement-item:hover {
    background: rgba(22, 119, 255, 0.05);
}

.announcement-item.unread {
    background: rgba(22, 119, 255, 0.02);
}

.announcement-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 24px;
    width: 6px;
    height: 6px;
    background: #ff4d4f;
    border-radius: 50%;
}

.announcement-item-summary {
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.announcement-item-left {
    flex: 1;
    min-width: 0;
}

.announcement-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.announcement-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 0;
}

.announcement-item.unread .announcement-item-title {
    color: #1677ff;
}

.announcement-item-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 10px;
    flex-shrink: 0;
}

.announcement-item-preview {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    display: none;
}

.announcement-item-time {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.announcement-item-time i {
    font-size: 11px;
}

.announcement-item-arrow {
    margin-left: 12px;
    color: #999;
    font-size: 12px;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.announcement-item.expanded .announcement-item-arrow {
    transform: rotate(90deg);
}

.announcement-item-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.announcement-item.expanded .announcement-item-detail {
    max-height: 1000px;
}

.announcement-item-detail-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid rgba(240, 240, 240, 0.5);
    margin-top: -8px;
    padding-top: 16px;
}

.announcement-item-full-content {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 空状态 */
.announcement-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #999;
}

.announcement-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ddd;
}

.announcement-empty p {
    font-size: 15px;
    color: #999;
}

/* 暗色模式支持 */
.dark-mode .announcement-sidebar {
    background: rgba(26, 26, 26, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-left-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .announcement-sidebar-header {
    background: rgba(26, 26, 26, 0.3);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .announcement-sidebar-title {
    color: #fff;
}

.dark-mode .announcement-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.dark-mode .announcement-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #1677ff;
}

.dark-mode .announcement-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .announcement-item:hover {
    background: rgba(22, 119, 255, 0.1);
}

.dark-mode .announcement-item.unread {
    background: rgba(22, 119, 255, 0.05);
}

.dark-mode .announcement-item-title {
    color: #fff;
}

.dark-mode .announcement-item-preview {
    color: #ccc;
}

.dark-mode .announcement-item-time {
    color: #999;
}

.dark-mode .announcement-item-full-content {
    color: #ccc;
}

.dark-mode .announcement-item-detail-content {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .announcement-empty i {
    color: #444;
}

.dark-mode .announcement-empty p {
    color: #666;
}

.dark-mode .loading-text {
    color: #666;
}

/* 公告详情弹窗 */
.announcement-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.announcement-detail-modal.show {
    display: flex;
    opacity: 1;
}

.announcement-detail-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.announcement-detail-header {
    padding: 20px;
    border-bottom: 1px solid rgba(240, 240, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.announcement-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    margin-right: 12px;
}

.announcement-detail-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
    font-size: 16px;
    flex-shrink: 0;
}

.announcement-detail-close:hover {
    background: #e0e0e0;
    color: #1677ff;
}

.announcement-detail-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.announcement-detail-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}

.announcement-detail-date i {
    font-size: 14px;
}

.announcement-detail-text {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.announcement-detail-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(240, 240, 240, 0.8);
    display: flex;
    justify-content: center;
}

.announcement-detail-btn {
    padding: 10px 32px;
    background: linear-gradient(135deg, #1677ff 0%, #0e5cd1 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
}

.announcement-detail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 119, 255, 0.4);
}

.announcement-detail-btn:active {
    transform: translateY(0);
}

/* 暗色模式 - 详情弹窗 */
.dark-mode .announcement-detail-content {
    background: rgba(26, 26, 26, 0.95);
}

.dark-mode .announcement-detail-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .announcement-detail-title {
    color: #fff;
}

.dark-mode .announcement-detail-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.dark-mode .announcement-detail-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #1677ff;
}

.dark-mode .announcement-detail-text {
    color: #ccc;
}

.dark-mode .announcement-detail-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}
