/* 系统公告样式：卡片网格、筛选栏、上架/下架切换、类型与可见范围标签、详情/编辑/紧急弹窗 */

/* 类型筛选栏 */
.ann-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px 0;
}
.ann-filter-btn {
    padding: 6px 16px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    transition: all 0.15s;
}
.ann-filter-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}
.ann-filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* 当前上架 / 已下架 切换 */
.ann-toggle {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 8px;
}
.ann-toggle-btn {
    padding: 6px 14px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 0.88rem;
    color: #374151;
}
.ann-toggle-btn.active {
    background: #2563eb;
    color: #fff;
}

/* 卡片网格：桌面 3 列、平板 2 列、移动 1 列 */
.ann-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) {
    .ann-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .ann-grid { grid-template-columns: 1fr; }
}

.ann-card {
    position: relative;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s;
}
.ann-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* 卡片边框按类型上色 */
.ann-card-type-URGENT   { border-color: #ef4444; }   /* 紧急：红 */
.ann-card-type-SERVER   { border-color: #3b82f6; }   /* 服务器：蓝 */
.ann-card-type-INTERNAL { border-color: #f59e0b; }   /* 内部：金 */
/* 置顶状态由右上角红色 .ann-pin-badge 角标 + 红色光晕表达，不占用 border-color，避免覆盖类型边框 */
.ann-card.is-pinned {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
/* 置顶角标（全员可见，红色） */
.ann-pin-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.ann-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.ann-tag {
    font-size: 0.74rem;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.ann-tag-type-INTERNAL { background: #fef3c7; color: #b45309; }   /* 内部：金（与金色边框呼应） */
.ann-tag-type-SERVER   { background: #dbeafe; color: #1d4ed8; }   /* 服务器：蓝 */
.ann-tag-type-URGENT   { background: #fee2e2; color: #b91c1c; }   /* 紧急：红 */
/* 可见范围标签（仅管理员可见，前端按角色显隐） */
.ann-tag-scope {
    background: #f1f5f9;
    color: #475569;
    font-weight: 500;
}
.ann-tag-status {
    background: #fef3c7;
    color: #92400e;
}
.ann-tag-status.expired { background: #fee2e2; color: #b91c1c; }
/* 置顶行内标签（详情弹窗用；卡片置顶用 .ann-pin-badge 角标） */
.ann-tag-pin { background: #ef4444; color: #fff; font-weight: 600; }
.ann-detail-tags { margin-bottom: 8px; }

.ann-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin: 4px 0 8px 0;
    line-height: 1.4;
}
.ann-card-summary {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ann-card-meta {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}
.ann-card-meta .edited { color: #f59e0b; }
.ann-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}
.ann-card-actions .btn { padding: 4px 12px; font-size: 0.82rem; }

.ann-empty {
    text-align: center;
    color: #9ca3af;
    padding: 48px 0;
    font-size: 0.95rem;
}

/* 详情弹窗正文（富文本渲染区） */
.ann-detail-meta {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.ann-detail-content {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    max-height: 55vh;
    overflow-y: auto;
    line-height: 1.7;
    font-size: 0.95rem;
    /* 显式左对齐：覆盖 .modal-content 的 text-align:center 继承，
       否则富文本正文会被居中，与编辑页左对齐不一致 */
    text-align: left;
}
/* 详情正文富文本排版：补全 p/h/list/blockquote/code/table 等样式，对齐 wangEditor 编辑区的视觉效果
   （此前详情页仅 line-height+img+table，其余标签走浏览器默认，与编辑页差距明显） */
.ann-detail-content p { margin: 0 0 12px; }
.ann-detail-content p:last-child { margin-bottom: 0; }
.ann-detail-content h1 { font-size: 1.5rem; font-weight: 700; margin: 20px 0 10px; line-height: 1.3; }
.ann-detail-content h2 { font-size: 1.35rem; font-weight: 700; margin: 18px 0 8px; line-height: 1.3; }
.ann-detail-content h3 { font-size: 1.2rem; font-weight: 600; margin: 16px 0 8px; line-height: 1.3; }
.ann-detail-content h4 { font-size: 1.05rem; font-weight: 600; margin: 14px 0 6px; }
.ann-detail-content h5, .ann-detail-content h6 { font-size: 1rem; font-weight: 600; margin: 12px 0 6px; }
.ann-detail-content ul, .ann-detail-content ol { margin: 0 0 12px; padding-left: 26px; }
.ann-detail-content li { margin: 4px 0; }
.ann-detail-content blockquote {
    margin: 0 0 12px;
    padding: 8px 14px;
    border-left: 4px solid #d1d5db;
    background: #f9fafb;
    color: #4b5563;
    border-radius: 0 6px 6px 0;
}
.ann-detail-content a { color: #2563eb; text-decoration: underline; }
.ann-detail-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}
.ann-detail-content pre {
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}
.ann-detail-content pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.ann-detail-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.ann-detail-content img { max-width: 100%; height: auto; border-radius: 6px; }
.ann-detail-content table { border-collapse: collapse; margin: 0 0 12px; max-width: 100%; }
.ann-detail-content th, .ann-detail-content td { border: 1px solid #e5e7eb; padding: 6px 10px; }
.ann-detail-content th { background: #f9fafb; font-weight: 600; }

/* 发布/编辑弹窗内的角色勾选与有效期 */
.ann-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ann-roles label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #374151;
}
.ann-roles input[type="checkbox"] { width: 16px; height: 16px; }
.ann-roles label.disabled { color: #9ca3af; cursor: not-allowed; }
.ann-hint { display: block; color: #6b7280; font-size: 0.8rem; margin-top: 6px; }

.ann-expire { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.ann-expire label { font-size: 0.9rem; color: #374151; display: inline-flex; align-items: center; gap: 4px; }
.ann-expire-extra { margin-top: 8px; display: flex; gap: 8px; align-items: center; }

/* wangEditor 容器 */
.ann-editor {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 220px;
}
.ann-editor:focus { outline: none; border-color: #2563eb; }

/* 紧急公告弹窗列表 */
.ann-urgent-sub { color: #6b7280; font-size: 0.9rem; margin-bottom: 12px; }
.ann-urgent-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.ann-urgent-item {
    padding: 12px 14px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.ann-urgent-item:hover { background: #fee2e2; }
.ann-urgent-item-title { font-weight: 600; color: #b91c1c; font-size: 0.95rem; }
.ann-urgent-item-summary { font-size: 0.84rem; color: #7f1d1d; margin-top: 4px; opacity: 0.85; }
