/* =============================================
   官方公告內文排版 (.news-article)
   - 前台 index.html 公告彈窗、後台 admin_news.html 預覽共用
   - 後台編輯器 (Quill) 輸出的 h2/h3/p/strong/em/u/a/hr/ul/ol/img 都在這裡定義樣式
   - 顏色走 app.css 的 CSS 變數；後台沒有 app.css 時用 fallback 值 (深色)
   ============================================= */

.news-article {
    font-size: 15px;
    line-height: 1.7;
    color: var(--news-body, #e5e5ea);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.news-article > :first-child { margin-top: 0; }
.news-article > :last-child { margin-bottom: 0; }

.news-article p {
    margin: 0 0 12px;
}

/* 空段落 (Quill 用 <p><br></p> 當空行) 縮小一點，避免上下留白過大 */
.news-article p:empty,
.news-article p > br:only-child {
    display: block;
    min-height: 0.6em;
}

/* 標題：粉紅記號 ▍ + 粗體 */
.news-article h1,
.news-article h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 8px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main, #f5f5f7);
}

.news-article h1::before,
.news-article h2::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--accent-color, #fc3c7b);
}

.news-article h3 {
    margin: 16px 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main, #f5f5f7);
}

.news-article strong,
.news-article b {
    font-weight: 700;
    color: var(--text-main, #ffffff);
}

.news-article em,
.news-article i { font-style: italic; }
.news-article u { text-decoration: underline; text-underline-offset: 3px; }
.news-article s { text-decoration: line-through; }

.news-article a {
    color: var(--accent-color, #fc3c7b);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: opacity 0.2s;
}

.news-article a:hover { opacity: 0.8; }

.news-article hr {
    border: 0;
    height: 1px;
    background: var(--border-color, #38383A);
    margin: 20px 0;
}

/* 圖片：滿版圓角，點一下可放大 (前台 JS 會包一層 .news-img) */
.news-article img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color, #2a2a2c);
    margin: 14px 0;
    cursor: zoom-in;
}

.news-article .news-img {
    position: relative;
    margin: 14px 0;
    line-height: 0;
}

.news-article .news-img img { margin: 0; }

.news-article .news-img-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.news-article ul,
.news-article ol {
    margin: 0 0 12px;
    padding-left: 22px;
}

.news-article li { margin: 2px 0; }
.news-article li::marker { color: var(--accent-color, #fc3c7b); }

.news-article blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--news-quote-bg, #2c2c2e);
    color: var(--text-sub, #a1a1a6);
}

.news-article pre {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--news-quote-bg, #2c2c2e);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

/* Quill 對齊 class */
.news-article .ql-align-center { text-align: center; justify-content: center; }
.news-article .ql-align-right { text-align: right; justify-content: flex-end; }
.news-article .ql-align-justify { text-align: justify; }

/* 舊版公告：純文字用 \n 換行 (沒有 <p>)，保留 pre-wrap 行為 */
.news-article.is-legacy {
    white-space: pre-wrap;
}
