/* 新闻动态 - 首页区块 */
.news-section {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    margin-bottom: 24px;
}
.news-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.news-section .section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* 首页概览中的新闻动态小卡片（放在 #defaultStatsGrid 内） */
#dashboardPage #defaultStatsGrid .news-card {
    grid-column: 1 / -1; /* 占满整行，但保持与其他 stat-card 一致的卡片样式（圆角、阴影、内边距等） */
}
.news-card-body {
    display: flex;
    align-items: stretch;
    gap: 20px;
    width: 100%;
    min-width: 0;
}
/* 新闻动态区（轮播+列表）合计 400px */
.news-card-body .news-carousel {
    flex: 0 0 160px;
    width: 160px;
}
.news-card-body .news-list {
    flex: 1 1 0;
    min-width: 0;
}
/* 通知公告区与新闻列表平分右侧剩余空间 */
.news-card-body .notice-section {
    flex: 1 1 0;
    min-width: 0;
    margin-left: 40px;
    padding-left: 20px;
    border-left: 1px solid #e5e7eb;
}
.notice-section-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.notice-section-title i {
    color: #059669;
}
.notice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.notice-list-empty {
    color: #9ca3af;
    font-size: 13px;
    padding: 12px 0;
}
.notice-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}
.notice-list-item:last-child {
    border-bottom: none;
}
.notice-list-item:hover {
    background: #f9fafb;
    border-radius: 6px;
}
.notice-list-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #059669;
    flex-shrink: 0;
}
.notice-list-body {
    flex: 1;
    min-width: 0;
}
.notice-list-title {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notice-list-title:hover {
    color: #059669;
}
.notice-list-meta {
    font-size: 12px;
    color: #6b7280;
}
/* 标题行与 body 三列对齐：160px | 1fr | 1fr，gap 20px */
.news-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 20px;
    width: 100%;
    min-width: 0;
}
.news-card-header .news-card-title {
    flex: 0 0 160px;
}
.news-card-header-spacer {
    flex: 1 1 0;
    min-width: 0;
}
.news-card-header .notice-section-title {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}
.news-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* 防止“新闻动态”换行 */
}
.news-card-title i {
    color: #2563eb;
}

.news-card-more {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap; /* 防止“更多”单独换行 */
}
.news-card-more i {
    font-size: 11px;
}
.news-card-more:hover {
    color: #2563eb;
}

/* 新闻轮播区域 */
.news-carousel {
    position: relative;
    min-height: 140px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.2);
}
.news-carousel-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #b91c1c;
}
.news-carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #e5e7eb;
}
.news-carousel-slide.active {
    opacity: 1;
}
.news-carousel-dots {
    display: flex;
    gap: 4px;
}
.news-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.3);
}
.news-carousel-dot.active {
    background: #7f1d1d;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.news-list-empty {
    color: #9ca3af;
    text-align: center;
    padding: 16px;
}
.news-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    border-bottom: 1px solid #f3f4f6;
}
.news-list-item:last-child {
    border-bottom: none;
}
.news-list-item:hover {
    background: #f9fafb;
    border-radius: 6px;
}
.news-list-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #dc2626;
    flex-shrink: 0;
}
.news-list-body {
    flex: 1;
    min-width: 0;
}
.news-list-title {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-list-title:hover {
    color: #2563eb;
}
.news-list-meta {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-list-date-box {
    width: 52px;
    padding: 4px 6px;
    border-radius: 4px;
    background: #f3f4f6;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.2;
    color: #4b5563;
}
.news-list-date-day {
    display: block;
    font-size: 16px;
    font-weight: 600;
}
.news-list-date-month {
    display: block;
    font-size: 12px;
}

/* 新闻管理页 */
.news-management-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.news-management-page .page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}
.news-management-content {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 20px;
}
.news-table-wrap {
    overflow-x: auto;
}
.news-table {
    width: 100%;
    border-collapse: collapse;
}
.news-table th,
.news-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.news-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}
.news-table .loading-cell,
.news-table .empty-cell {
    text-align: center;
    padding: 32px;
    color: #6b7280;
}
.news-actions {
    white-space: nowrap;
}
.news-action-link {
    margin-right: 12px;
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
}
.news-action-link:hover {
    text-decoration: underline;
}
.status-badge.status-published {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.status-badge.status-draft {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.news-pagination {
    margin-top: 16px;
    text-align: center;
}
.news-pagination .btn-sm {
    margin: 0 4px;
}

.news-form-modal .form-group {
    margin-bottom: 16px;
}
.news-form-modal label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}
.news-form-modal .required {
    color: #dc2626;
}
.news-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.news-upload-name {
    font-size: 13px;
    color: #6b7280;
}
.news-attachment-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}
.news-attachment-list li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.news-remove-attachment {
    font-size: 12px;
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
}

/* 新建/编辑新闻独立页面 */
.news-edit-container {
    padding: 0;
    max-width: 900px;
    margin: 0 auto;
}
.news-edit-page {
    padding: 24px 0;
}
.news-edit-page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.news-edit-back {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
}
.news-edit-back:hover {
    text-decoration: underline;
}
.news-edit-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
}
.news-edit-form-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.news-edit-form-card .form-group {
    margin-bottom: 20px;
}
.news-edit-form-card .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}
.news-edit-form-card .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.news-edit-form-card .form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.news-edit-form-card .form-input-sm {
    padding: 6px 8px;
    font-size: 13px;
    width: auto;
    min-width: 100px;
}
.news-edit-form-card textarea.form-input {
    min-height: 200px;
    resize: vertical;
}
.news-edit-form-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 富文本编辑器 */
.news-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 8px;
    align-items: center;
}
.news-editor-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.news-editor-label {
    font-size: 13px;
    color: #6b7280;
}
.btn.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}
.news-content-editor {
    min-height: 220px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.7;
    color: #111827;
    caret-color: #111827;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    background-color: #ffffff;
    pointer-events: auto;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
.news-content-editor:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.news-content-editor p {
    margin: 0 0 10px 0;
}
.news-content-editor.indent-first-line p,
.news-content-editor.indent-first-line {
    text-indent: 2em;
}
.news-content-editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px auto;
}

/* 新闻详情页 */
.news-detail-container {
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
}
.news-detail-loading,
.news-detail-error {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}
.news-detail-header {
    margin-bottom: 20px;
}
.news-detail-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}
.news-detail-date {
    font-size: 14px;
    color: #6b7280;
}
.news-detail-cover {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}
.news-detail-cover img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}
.news-detail-body {
    line-height: 1.7;
    color: #374151;
    margin-bottom: 24px;
}
.news-detail-body p {
    margin: 0 0 12px 0;
}
.news-detail-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px auto;
}
.news-detail-attachments {
    margin-bottom: 24px;
}
.news-detail-attachments h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1f2937;
}
.news-detail-attachments ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.news-detail-attachments li {
    padding: 6px 0;
}
.news-detail-attachments a {
    color: #2563eb;
    text-decoration: none;
}
.news-detail-attachments a:hover {
    text-decoration: underline;
}
.news-detail-back {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}
.news-detail-back-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
}
.news-detail-back-link:hover {
    text-decoration: underline;
}
