/* Easterntimes TECH · 新闻模块：后台发布面板 / 前台文章排版 */

/* ============ 后台发布面板 ============ */
#newsModal {
    position: fixed; inset: 0; z-index: 99999;
    display: none; align-items: center; justify-content: center;
    padding: 20px; background: rgba(10, 12, 18, .72);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
#newsModal .ne-dialog {
    position: relative; width: min(1180px, 96vw); max-height: 94vh;
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border-radius: 14px; color: #1f2937;
    box-shadow: 0 28px 72px rgba(0, 0, 0, .4);
}
#newsModal .ne-head {
    flex: none; display: flex; align-items: center; gap: 14px;
    padding: 16px 24px; border-bottom: 1px solid #e9edf2;
    background: linear-gradient(100deg, #fffdf5, #fff);
}
#newsModal .ne-head .ne-icon {
    width: 38px; height: 38px; flex: none; border-radius: 10px;
    background: #C8960A; color: #fff; font-size: 19px;
    display: flex; align-items: center; justify-content: center;
}
#newsModal .ne-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: #1f2937; }
#newsModal .ne-head p { margin: 3px 0 0; font-size: 12px; color: #8a93a0; }
#newsModal .ne-close {
    margin-left: auto; padding: 3px 10px; border: none; border-radius: 6px;
    background: transparent; color: #9aa3af; font-size: 24px; line-height: 1; cursor: pointer;
}
#newsModal .ne-close:hover { background: #f1f3f6; color: #1f2937; }

#newsModal form#newsForm { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
#newsModal .ne-body {
    display: grid; grid-template-columns: minmax(0, 1fr) 320px;
    flex: 1; min-height: 0;
}
#newsModal .ne-main { min-width: 0; padding: 20px 24px 24px; overflow-y: auto; }
#newsModal .ne-side { padding: 20px; overflow-y: auto; background: #f8f9fb; border-left: 1px solid #e9edf2; }
#newsModal .ne-section { margin-bottom: 18px; }
#newsModal .ne-section-title {
    margin: 0 0 10px; font-size: 11px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: #a3acb8;
}
#newsModal .ne-card { padding: 14px 16px 2px; background: #fff; border: 1px solid #e5e9ef; border-radius: 10px; }

/* 覆盖后台深色表单变量 */
#newsModal .form-row { display: flex; gap: 12px; }
#newsModal .form-row > .form-group { flex: 1; min-width: 0; }
#newsModal .form-group { margin-bottom: 14px; }
#newsModal .form-group label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: #4b5563; }
#newsModal .form-group input,
#newsModal .form-group select,
#newsModal .form-group textarea {
    box-sizing: border-box; width: 100%; padding: 9px 12px;
    background: #fff; color: #1f2937; border: 1px solid #d8dde5;
    border-radius: 8px; font-size: 13px; line-height: 1.5;
}
#newsModal .form-group input:focus,
#newsModal .form-group select:focus,
#newsModal .form-group textarea:focus {
    border-color: #C8960A; outline: none; box-shadow: 0 0 0 3px rgba(200, 150, 10, .13);
}
#newsModal .form-group textarea { min-height: 0; resize: vertical; }
#newsModal .ne-title-input { padding: 12px 14px !important; font-size: 16px !important; font-weight: 600; }
#newsModal .ne-hint { margin-top: 6px; font-size: 11px; line-height: 1.6; color: #8a93a0; }
#newsModal .ne-side .ne-card { padding: 14px 16px 2px; }

/* 编辑器 */
#newsModal .ne-editor-wrap { overflow: hidden; background: #fff; border: 1px solid #d8dde5; border-radius: 10px; }
#newsModal .ne-tabs {
    display: flex; align-items: center; gap: 4px; padding: 8px 10px;
    background: #fafbfc; border-bottom: 1px solid #e9edf2;
}
#newsModal .ne-tab {
    padding: 6px 14px; border: none; border-radius: 7px; background: transparent;
    color: #6b7280; font-size: 12px; font-weight: 600; cursor: pointer;
}
#newsModal .ne-tab.active { background: #fff; color: #1f2937; box-shadow: 0 1px 4px rgba(0, 0, 0, .09); }
#newsModal .ne-spacer { flex: 1; }
#newsModal .ne-tool {
    padding: 5px 10px; border: 1px solid #e2e6ec; border-radius: 6px;
    background: #fff; color: #4b5563; font-size: 12px; cursor: pointer;
}
#newsModal .ne-tool:hover { border-color: #C8960A; color: #A67C00; }
#newsModal .ne-tool-accent { border-color: #EFD9A0; background: #FFF9E9; color: #A67C00; font-weight: 600; }
#newsModal .ne-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
    padding: 7px 10px; background: #fff; border-bottom: 1px solid #e9edf2;
}
#newsModal .ne-toolbar .ne-tb {
    min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent;
    border-radius: 6px; background: transparent; color: #374151;
    font-size: 13px; cursor: pointer; white-space: nowrap;
}
#newsModal .ne-toolbar .ne-tb:hover { background: #fdf6e3; border-color: #f0e2b6; color: #A67C00; }
#newsModal .ne-toolbar .ne-tb-accent { color: #A67C00; font-weight: 700; }
#newsModal .ne-toolbar .ne-sep { width: 1px; height: 20px; margin: 0 5px; background: #e5e9ef; }
#newsModal .ne-pane { display: none; }
#newsModal .ne-pane.active { display: block; }
#newsModal .ne-editor {
    min-height: 300px; max-height: 46vh; padding: 18px 22px; overflow-y: auto;
    outline: none; background: #fff; font-size: 14px; line-height: 1.8; color: #1f2937;
}
#newsModal .ne-editor:empty::before { content: attr(data-placeholder); color: #b6bdc7; }
#newsModal .ne-hidden { display: none; }
#newsModal .ne-pane.source-on .ne-editor { display: none; }
#newsModal .ne-pane.source-on .ne-hidden {
    display: block; box-sizing: border-box; width: 100%; min-height: 300px; max-height: 46vh;
    padding: 16px 18px; border: none; outline: none; resize: vertical;
    background: #fbfcfe; color: #374151; font-family: Consolas, Monaco, monospace;
    font-size: 12px; line-height: 1.7;
}
#newsModal .ne-status {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 7px 12px; border-top: 1px solid #eef1f5;
    background: #fafbfc; color: #9aa3af; font-size: 11px;
}
#newsModal .ne-cover {
    width: 100%; height: 110px; margin-top: 4px; border: 1px dashed #d8dde5;
    border-radius: 8px; background: #fff; color: #b6bdc7; font-size: 12px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#newsModal .ne-cover img { width: 100%; height: 100%; object-fit: cover; }
#newsModal .ne-foot {
    flex: none; display: flex; align-items: center; gap: 10px;
    padding: 13px 24px; border-top: 1px solid #e9edf2; background: #fff;
}
#newsModal .ne-foot-hint { color: #8a93a0; font-size: 12px; }
#newsModal .ne-btn {
    padding: 9px 18px; border: 1px solid #d8dde5; border-radius: 8px;
    background: #fff; color: #4b5563; font-size: 13px; font-weight: 600; cursor: pointer;
}
#newsModal .ne-btn:hover { border-color: #C8960A; color: #A67C00; }
#newsModal .ne-btn-primary { background: #C8960A; border-color: #C8960A; color: #fff; }
#newsModal .ne-btn-primary:hover { background: #A67C00; color: #fff; }
#newsModal .ne-preview {
    position: absolute; inset: 0; z-index: 8; display: none;
    flex-direction: column; background: #fff;
}
#newsModal .ne-preview.show { display: flex; }
#newsModal .ne-preview-head {
    display: flex; align-items: center; gap: 10px; flex: none;
    padding: 14px 24px; border-bottom: 1px solid #e9edf2; font-size: 14px;
}
#newsModal .ne-preview-body { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 40px; }

@media (max-width: 900px) {
    #newsModal .ne-body { grid-template-columns: 1fr; }
    #newsModal .ne-side { border-left: none; border-top: 1px solid #e9edf2; }
    #newsModal .form-row { flex-direction: column; gap: 0; }
}

/* ============ 新闻文章排版（前台详情 + 后台预览共用） ============ */
.news-article { color: #333; font-size: 15px; line-height: 1.9; word-wrap: break-word; }
.news-article > :first-child { margin-top: 0; }
.news-article p { margin: 0 0 18px; }
.news-article h2 {
    margin: 34px 0 14px; padding-left: 13px; border-left: 4px solid #C8960A;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 1.55rem;
    font-weight: 700; line-height: 1.35; color: #1A1A1A;
}
.news-article h3 { margin: 26px 0 12px; font-size: 1.2rem; font-weight: 700; color: #1A1A1A; }
.news-article h4 { margin: 22px 0 10px; font-size: 1.05rem; font-weight: 700; color: #1A1A1A; }
.news-article strong { color: #1A1A1A; font-weight: 700; }
.news-article a { color: #A67C00; text-decoration: underline; text-underline-offset: 3px; }
.news-article a:hover { color: #C8960A; }
.news-article ul, .news-article ol { margin: 0 0 20px; padding-left: 24px; }
.news-article li { margin-bottom: 8px; }
.news-article li::marker { color: #C8960A; }
.news-article blockquote {
    margin: 24px 0; padding: 14px 20px; border-left: 4px solid #C8960A;
    border-radius: 0 8px 8px 0; background: #FFF9E9; color: #5c4a13; font-size: 0.97rem;
}
.news-article blockquote p:last-child { margin-bottom: 0; }
.news-article blockquote.news-callout { background: #FFF3CD; }
.news-article img { display: block; max-width: 100%; height: auto; margin: 22px auto; border-radius: 8px; }
.news-article hr { margin: 32px 0; border: none; border-top: 1px solid #E8E0C8; }
.news-article table { width: 100%; margin: 22px 0; border-collapse: collapse; font-size: 0.93rem; }
.news-article th, .news-article td { padding: 10px 14px; border: 1px solid #E8E0C8; text-align: left; }
.news-article th { background: #F7F1DE; color: #1A1A1A; font-weight: 700; }
.news-article code { padding: 2px 6px; border-radius: 4px; background: #F3F4F6; font-size: 0.9em; }
.news-article pre { padding: 16px; overflow-x: auto; border-radius: 8px; background: #1F2430; color: #E1E4E8; }
.news-article pre code { padding: 0; background: none; color: inherit; }

/* ============ 前台新闻列表卡片 ============ */
.news-card { transition: border-color .2s, box-shadow .2s, transform .2s; }
.news-card:hover {
    border-color: #E3CF9A !important; transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(26, 26, 26, .10);
}
.news-card-title a:hover { color: #A67C00 !important; }
.news-card-more { display: inline-block; transition: color .2s; }
.news-card-more:hover { color: #A67C00 !important; }
