/* 社會543 前後台共用元件樣式（前台主題見 front.css；後台使用 AdminLTE） */
:root { --tw-accent: #e11d48; --tw-push: #16a34a; --tw-boo: #e11d48; --tw-gloss-line: rgba(225, 29, 72, .5); }
[data-bs-theme="dark"] { --tw-accent: #fb7185; --tw-push: #4ade80; --tw-boo: #fb7185; --tw-gloss-line: rgba(251, 113, 133, .6); }

/* 專有名詞自動連結：第一次出現加底線，滑過顯示一句話解釋 */
a.gloss-term { color: inherit; text-decoration: underline dotted var(--tw-gloss-line); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: help; }
a.gloss-term:hover { color: var(--tw-accent); text-decoration-style: solid; }

/* 內文圖片與影片 */
.post-media { margin: 1rem 0; text-align: center; }
.post-media img, .post-media video { max-width: 100%; max-height: 80vh; border-radius: 14px; background: #000; }
.post-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.post-gallery a, .post-gallery video { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: var(--bs-secondary-bg); width: 100%; }
.post-gallery img { width: 100%; height: 100%; object-fit: cover; }
.media-blur img, .media-blur video { filter: blur(18px); }

/* 案件時間軸 */
.case-timeline { position: relative; padding-left: 1.5rem; list-style: none; margin: 0; }
.case-timeline::before { content: ""; position: absolute; left: .45rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--bs-border-color); }
.case-timeline li { position: relative; margin-bottom: 1rem; }
.case-timeline li::before { content: ""; position: absolute; left: -1.33rem; top: .35rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--tw-accent); box-shadow: 0 0 0 3px var(--bs-body-bg); }
.case-timeline .tl-time { font-size: .8rem; color: var(--bs-secondary-color); }

/* 留言 */
.mention { color: var(--bs-link-color); font-weight: 600; }
.badge-op { background: var(--tw-accent); color: #fff; }
.is-folded .folded-body { display: none; }
.folded-note { font-size: .85rem; color: var(--bs-secondary-color); }

/* 上傳 */
.upload-drop { border: 2px dashed var(--bs-border-color); border-radius: 16px; padding: 1.25rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-drop.dragover { border-color: var(--tw-accent); background: var(--bs-tertiary-bg); }
.upload-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.upload-item { position: relative; border: 1px solid var(--bs-border-color); border-radius: 14px; overflow: hidden; background: var(--bs-body-bg); }
.upload-item .preview { aspect-ratio: 4 / 3; background: var(--bs-secondary-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.upload-item .preview img, .upload-item .preview video { width: 100%; height: 100%; object-fit: cover; }
.upload-item .meta { padding: .4rem .5rem; font-size: .75rem; }
.upload-item .progress { height: 4px; border-radius: 0; }

/* 後台 */
.admin-area .table td, .admin-area .table th { vertical-align: middle; }
.overdue { background: rgba(220, 53, 69, .12) !important; }
.highlight-num { background: rgba(255, 193, 7, .35); border-radius: .2rem; padding: 0 .1rem; }
.highlight-name { background: rgba(13, 110, 253, .2); border-radius: .2rem; padding: 0 .1rem; }
.highlight-pii { background: rgba(220, 53, 69, .22); border-radius: .2rem; padding: 0 .1rem; }
.diff-del { background: rgba(220, 53, 69, .2); text-decoration: line-through; }
.diff-ins { background: rgba(25, 135, 84, .2); }
.admin-area .post-body { line-height: 1.85; }
.badge-soft { background: var(--bs-secondary-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color); font-weight: 500; }

/* ── 自訂 LOGO（後台「外觀 / LOGO」上傳） ─────────────────── */
.brand-logo { max-width: 100%; height: auto; }
.brand-logo-dark { display: none !important; }
[data-bs-theme="dark"] .brand-logo-light { display: none !important; }
[data-bs-theme="dark"] .brand-logo-dark { display: inline-block !important; }
.brand-logo-lg { height: var(--brand-login-h, 56px); width: auto; max-width: min(100%, 480px); object-fit: contain; }
.brand-logo-admin { display: inline-flex; align-items: center; vertical-align: middle; margin-left: .5rem; }
.brand-logo-admin img { height: var(--brand-admin-h, 30px); width: auto; max-width: 170px; object-fit: contain; object-position: left center; }
.brand-logo-admin.on-light { background: #fff; border-radius: 6px; padding: 3px 6px; }
