:root {
    --bg: #150f1a;
    --bg-deep: #0d0a10;
    --surface: #241825;
    --text: #f5ecf0;
    --text-muted: #f5ecf0;
    --accent-start: #ff6f9c;
    --accent-end: #b969f5;
    --hairline: rgba(245, 236, 240, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    min-height: var(--vh100, 100vh);
    max-width: 100vw;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 700px 500px at 88% -8%, rgba(255, 111, 156, 0.16), transparent 60%),
        radial-gradient(ellipse 600px 500px at -8% 100%, rgba(185, 105, 245, 0.14), transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    /* 擋掉手機瀏覽器原生的「下拉重新整理」手勢，尤其是通知頁用 iframe 嵌入看
       貼文的情境下，鍵盤收起後很容易在還沒捲到最頂端時就誤觸發這個手勢，變成
       整個頁面重新整理。這個屬性是瀏覽器原生設計來處理這個問題的，不會影響
       正常的捲動 */
    overscroll-behavior-y: contain;
}

.impersonate-banner {
    background: linear-gradient(120deg, #ffb020, #ff7a45);
    color: #2a1600;
    font-weight: 600;
    text-align: center;
    padding: 0.7rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.impersonate-banner a {
    color: #2a1600;
    text-decoration: underline;
    font-weight: 700;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
}

main {
    overflow-x: hidden;
}

.wordmark {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}

.site-nav a:hover {
    color: var(--text);
}

.notif-link {
    position: relative;
}

.notif-badge {
    display: inline-block;
    background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
    color: #1a0f1c;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.3rem;
    vertical-align: 2px;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notif-item {
    display: block;
    padding: 1rem;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
}

.notif-item-unread {
    border: 1px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box,
                linear-gradient(120deg, var(--accent-start), var(--accent-end)) border-box;
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
    align-self: center;
}

.notif-line {
    display: flex;
    gap: 0.4rem;
    align-items: baseline;
    font-size: 18px;
}

.notif-line .comment-author {
    font-size: 18px;
}

.notif-verb {
    color: var(--text-muted);
}

.notif-parent {
    color: var(--text-muted);
    font-size: 18px;
    margin: 0.5rem 0 0;
}

.notif-reply {
    font-size: 18px;
    margin: 0.2rem 0 0.5rem;
}

.notif-item .comment-time {
    font-size: 16px;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: var(--surface);
}

.thread-msg {
    align-self: flex-start;
    max-width: 75%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 0.6rem 0.9rem;
}

.thread-msg-me {
    align-self: flex-end;
    background: #f5ecf0;
}

.thread-msg-me .comment-time {
    color: rgba(26, 15, 28, 0.65);
}

.thread-msg-me .thread-msg-text {
    color: #1a0f1c;
}

.thread-msg-text {
    margin: 0 0 0.2rem;
}

.nav-cta {
    background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
    color: #1a0f1c !important;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem !important;
}

.nav-user {
    color: var(--text-muted);
    margin-left: 1.5rem;
    font-size: 0.95rem;
}

.feed {
    max-width: 640px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

.is-embed .feed {
    padding-top: 1.25rem;
}

.feed-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 1rem;
    font-size: 1.05rem;
}

.post-card {
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--hairline);
}

.post-card:first-child {
    padding-top: 0;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    margin-bottom: 0.6rem;
}

.post-author {
    font-weight: 600;
    color: var(--text);
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
    overflow-wrap: break-word;
}

.user-profile-head {
    margin-bottom: 1.5rem;
}

.user-profile-name {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: var(--text);
}

.post-time {
    font-size: 20px;
    color: var(--text-muted);
    overflow-wrap: break-word;
}

.post-caption {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.post-gallery {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.post-gallery::-webkit-scrollbar {
    display: none;
}

.post-gallery-item {
    flex: 0 0 auto;
    height: 340px;
    width: auto;
    border-radius: 10px;
    background: var(--surface);
}

img.post-gallery-item {
    cursor: zoom-in;
}

/* 影片在讀到 metadata 之前，瀏覽器不知道真正的寬高比，width: auto 會套用預設的
   2:1 fallback 比例撐出接近兩倍寬的方框，看起來像「先變超大又縮小」。這裡先頂住
   一個合理上限擋住那個暴衝；post-gallery-video.php 會在 metadata 讀到後把這個
   上限拿掉、換成算好的正確寬度。只套用在 video，不影響 img——圖片沒有這個
   fallback 比例的問題，不該被這個上限限制住原本可以更寬的橫式照片 */
video.post-gallery-item {
    max-width: 240px;
}

/* 影片改成點了才載入，畫面上先顯示這個假縮圖佔位（.video-lazy），沒有真的
   <video> 元素、不會去要求任何影片資料。還不知道影片實際比例，先假設直式手機
   影片常見的 9:16 當預設寬度，比空白方框或撐滿寬度合理；真正的寬度等使用者
   點下去、瀏覽器讀到 metadata 後才會校正 */
.post-gallery-item.video-lazy {
    width: 191px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

@media (max-width: 480px) {
    .post-gallery-item.video-lazy {
        width: 169px;
    }
}

/* 燈箱裡的影片控制列（照「柔蕊悄悄話」燈箱檢視器的樣子）：影片下方一條半透明的圓角面板 */
.site-lb {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    padding: 0 0 calc(14px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.site-lb-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    width: min(92vw, 340px);
    box-sizing: border-box;
    pointer-events: auto;
    transition: opacity 0.25s ease;
    cursor: default;
}

.site-lb.is-hidden .site-lb-bar { opacity: 0; pointer-events: none; }

.site-lb-seek { display: flex; align-items: center; gap: 8px; width: 100%; }

.site-lb-time {
    color: #fff;
    font-size: 12px;
    min-width: 34px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.site-lb-range {
    flex-grow: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    cursor: pointer;
    margin: 0;
    touch-action: none;
}

.site-lb-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.site-lb-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

.site-lb-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }

.site-lb-btns { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: nowrap; }

.site-lb-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.site-lb-btn:hover { background: rgba(255, 255, 255, 0.3); }
.site-lb-btn[hidden] { display: none; }
.site-lb-btn svg { width: 22px; height: 22px; display: block; }

/* 有控制列的時候，影片往上讓出位置，不要被控制列蓋住 */
.lightbox-slide.has-lbbar,
html:not(.site-embed) .lightbox-slide.lightbox-slide-video.has-lbbar {
    box-sizing: border-box;
    padding-bottom: 124px;
}

.lightbox.has-lbbar,
html:not(.site-embed) .lightbox.has-lbbar {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 124px);
}

html:not(.site-embed) .lightbox.has-lbbar #lightbox-video { margin-bottom: 0; max-height: 100%; }

/* 自己畫的影片控制列（不用瀏覽器原生的：原生控制列在 iPhone 上，兩指一放大就會直接變全螢幕） */
.site-vc {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.site-vc button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.site-vc-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.site-vc-center svg { width: 28px; height: 28px; margin-left: 2px; }

.site-vc:not(.is-paused) .site-vc-center { display: none; }

.site-vc-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 1.2rem 0.55rem 0.4rem;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
    pointer-events: auto;
    transition: opacity 0.2s;
}

.site-vc.is-lightbox .site-vc-bar {
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
}

.site-vc.is-idle .site-vc-bar {
    opacity: 0;
    pointer-events: none;
}

.site-vc-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-vc-btn[hidden] { display: none; }

.site-vc-time,
.site-vc-dur {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

.site-vc-track {
    position: relative;
    flex: 1 1 auto;
    min-width: 36px;
    height: 32px;
    touch-action: none;
    cursor: pointer;
    outline: none;
}

.site-vc-track::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.site-vc-fill {
    position: absolute;
    left: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    width: 0;
    border-radius: 2px;
    background: var(--accent-start, #ff5fa2);
}

.site-vc-knob {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.site-vc-track:focus-visible .site-vc-knob { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5); }

/* 方塊很窄的時候（直式小影片）：只留最需要的，時間文字收起來 */
.site-vc.is-narrow .site-vc-time,
.site-vc.is-narrow .site-vc-dur { display: none; }

/* 全螢幕：容器原本被設成固定像素大小，全螢幕時要撐滿整個螢幕 */
.post-gallery-item.video-lazy:fullscreen { width: 100vw !important; height: 100vh !important; border-radius: 0; }
.post-gallery-item.video-lazy:-webkit-full-screen { width: 100vw !important; height: 100vh !important; border-radius: 0; }

/* 燈箱裡的影片要能用兩指縮放（跟燈箱裡的圖片一樣，由網站自己處理手勢） */
video.lightbox-img { touch-action: none; }

/* 影片點下去之後：播放器放在佔位方塊裡面、跟方塊一樣大（影片比例不同時，上下或左右留黑邊） */
.post-gallery-item.video-lazy.is-playing {
    position: relative;
    display: block;
    overflow: hidden;
    cursor: default;
    background-color: #000;
}

.post-gallery-item.video-lazy > video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    border-radius: inherit;
}

/* 影片載入中的百分比、或失敗時的原因與「重試」鈕（蓋在影片上面） */
.video-load-status {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.video-load-status.is-error {
    background: rgba(0, 0, 0, 0.78);
    pointer-events: auto;
}

.video-load-retry {
    font: inherit;
    color: #fff;
    background: var(--accent-start, #ff5fa2);
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 1.4rem;
    cursor: pointer;
}

.video-lazy-play {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 純 CSS 畫的播放三角形，不用另外準備圖示檔案，也不受字型/emoji 顯示差異影響 */
.video-lazy-play::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
}

.post-gallery-wrap {
    position: relative;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(21, 15, 26, 0.75);
    border: 1px solid var(--hairline);
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.gallery-nav:hover {
    border-color: var(--accent-start);
}

.gallery-nav-prev {
    left: 0.5rem;
}

.gallery-nav-next {
    right: 0.5rem;
}

/* 只在滑鼠裝置上顯示，觸控裝置直接用手勢滑動就好 */
@media (hover: hover) and (pointer: fine) {
    .gallery-nav {
        display: flex;
    }
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.5rem 0;
}

.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(245, 236, 240, 0.35);
    transition: background 0.2s ease;
}

.gallery-dot.active {
    background: var(--accent-start);
}

@media (max-width: 480px) {
    .post-gallery-item {
        height: 300px; /* 固定像素值，完全不跟視窗高度掛鉤，工具列怎麼跳都不會影響這個尺寸 */
    }

    .site-header {
        flex-wrap: wrap;
        padding: 1rem 1.1rem;
        row-gap: 0.5rem;
        column-gap: 0.9rem;
        justify-content: flex-end;
    }

    .wordmark {
        font-size: 1.4rem;
        white-space: nowrap;
    }

    .site-nav {
        /* 讓裡面的連結變成跟網站名稱同一層的排版項目，可以直接接在後面排，空間不夠才換行，
           不用整個 nav 自己獨佔一行 */
        display: contents;
    }

    /* margin 加在 .site-nav 上沒有用（display: contents 沒有自己的邊界），
       改加在裡面第一個項目上，把它跟後面的項目一起推到最右邊，網站名稱留在最左邊 */
    .site-nav > *:first-child {
        margin-left: auto;
    }

    .site-nav a,
    .nav-user {
        margin-left: 0;
        font-size: 1.1rem;
    }
}

.auth-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: -0.9rem 0 1.25rem;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.post-report-link {
    color: var(--text-muted);
    font-size: 1rem;
    text-decoration: none;
}

.clear-media-btn {
    display: block;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

/* 檢舉處理卡片裡的「查看貼文」——跟 .clear-media-btn 一樣是拿 <button> 冒充純文字
   連結，所以一樣要把瀏覽器預設的按鈕邊框/底色都清掉，只留 .post-report-link 那份
   顏色與 hover 效果 */
.view-post-btn {
    display: inline-block;
    margin: 0.5rem 0 1rem;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}

.post-report-link:hover {
    color: var(--accent-start);
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 7, 12, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    z-index: 300;
    cursor: zoom-out;
    overflow: hidden;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* 圖片燈箱用自己的觸控事件做縮放/拖曳（見 messages.php），這裡停用瀏覽器對
   圖片本身的原生手勢（雙指縮放、拖曳），不然瀏覽器原生的頁面縮放會跟自訂的
   縮放搶著回應同一個手勢，放大時感覺像整頁（含背景）一起被放大跑掉；只套用
   在 img，不影響 video（影片維持原生控制列的手勢） */
img.lightbox-img {
    touch-action: none;
}

.like-form {
    display: inline-block;
}

.like-btn {
    background: none;
    border: 1px solid var(--hairline);
    color: var(--text-muted);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: inherit;
    margin-right: 0.6rem;
}

.like-btn.liked {
    color: var(--accent-start);
    border-color: var(--accent-start);
}

.post-status-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    background: rgba(255, 111, 111, 0.15);
    color: #ffb3b3;
    vertical-align: middle;
}

.post-delete-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0;
    cursor: pointer;
}

.post-delete-btn:hover {
    color: var(--accent-start);
}

.post-edit-link {
    margin-left: auto;
}

.comments-block {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hairline);
}

.comment-item {
    margin-bottom: 0.6rem;
}

.comment-line {
    display: flex;
    gap: 0.5rem;
    font-size: 17px;
}

.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.15rem;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-actions {
    display: flex;
    gap: 0.9rem;
}

.comment-reply-btn,
.comment-delete-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0;
    cursor: pointer;
}

.comment-reply {
    margin-left: 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--hairline);
    margin-top: 0.4rem;
}

@keyframes commentHighlightFade {
    0%   { background: rgba(255, 111, 156, 0.3); box-shadow: 0 0 0 4px rgba(255, 111, 156, 0.3); }
    75%  { background: rgba(255, 111, 156, 0.3); box-shadow: 0 0 0 4px rgba(255, 111, 156, 0.3); }
    100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}

.comment-highlight {
    animation: commentHighlightFade 4s ease-out;
    border-radius: 8px;
}

.reply-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.reply-form[hidden] {
    display: none;
}

.comment-quote {
    display: block;
    padding: 0.45rem 0.7rem;
    margin-bottom: 0.35rem;
    border-left: 3px solid var(--accent-start);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
}

.comment-quote-author {
    font-weight: 600;
    margin-right: 0.4rem;
}

.comment-quote-text {
    color: var(--text-muted);
}

.reply-quote-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    margin-bottom: 0.4rem;
    border-left: 3px solid var(--accent-start);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 100%;
}

.reply-quote-preview[hidden] {
    display: none;
}

.reply-form .comment-input {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.notif-item .comment-author {
    cursor: default;
}

.comment-text {
    color: var(--text-muted);
}

.comment-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* 從 0.5rem 加大到 1rem，跟上面那則留言的「回覆／刪除」拉開一點距離，
       避免太靠近容易誤點。.reply-form 也共用這個 class，回覆框一起套用到 */
    margin-top: 1rem;
}

.comment-input {
    margin-bottom: 0;
    flex: 1;
    box-sizing: border-box;
    height: 48px;
    /* 上下 padding 直接歸零，改用「行高」本身撐出可視高度——這是排版最底層的
       原理：文字本來就會卡在行高的正中間，不是瀏覽器選擇的置中演算法，不會有
       Chrome、Safari 算法不一致的問題。48px 扣掉上下邊框（2px×2）剩 44px，
       行高就設 44px，高度剛好整個用滿。跟按鈕同樣的道理，這個輸入框也套用
       .auth-input 這個 class，它的 padding 定義位置更後面，一樣要加 !important
       才蓋得過去（左右 padding 繼續用 .auth-input 那份） */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 44px;
    /* 鍵盤跳出來、輸入框被捲到看得到的位置時，留一點緩衝空間，不要讓輸入框緊貼著
       可視範圍邊緣——不然 focus 時那圈粉紅色柔邊光暈，會被切掉看不到 */
    scroll-margin-block: 24px;
    /* 平常（還沒點進去打字）邊框顏色太淡，幾乎看不出來哪裡可以留言——這裡蓋掉繼承
       來的淡邊框，換成看得清楚的粉色，不用點進去才看得到。加 !important 是因為
       .auth-input 這個 class 在檔案裡定義的位置比較後面，兩個 class 權重又一樣，
       沒有 !important 的話會被 .auth-input 自己的淡邊框蓋掉 */
    border: 2px solid rgba(255, 111, 156, 0.85) !important;
}

.comment-submit {
    white-space: nowrap;
    box-sizing: border-box;
    height: 48px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 46px;
    /* 這幾次改的都是「理論上應該置中」的寫法，但你的截圖一直顯示按鈕整體比
       輸入框低一截，不是文字置中的問題。這裡換個做法：不再猜理論，直接照你
       截圖看到的落差，用 position 把按鈕整個往上移一點，用結果去對，不是用
       算的去對。如果還是偏，跟我說「還要再往上」或「往下移一點」，改這個
       top 的數字就好，不用再截圖或量測 */
    position: relative;
    top: -9px;
    /* .admin-btn-reject 原本的邊框顏色是 --hairline，很淡幾乎看不到——換成比較
       明顯的白色。加 !important 一樣是因為 .admin-btn-reject 定義位置比較後面，
       權重相同時後面會贏，不加會被蓋掉 */
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.reply-cancel-btn {
    background: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    height: 48px;
    line-height: 46px;
    /* 本來完全沒有邊框，看起來只是純文字——加上跟「送出」一致的白色邊框、
       左右留一點空間，看起來才會像同一組按鈕 */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    padding: 0 1.1rem;
    position: relative;
    top: -9px;
}

.view-all-comments-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: block;
}

.view-thread-more-btn {
    margin-left: 1.5rem;
    padding-left: 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.view-all-comments-btn:hover {
    color: var(--accent-start);
}

.post-detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 7, 12, 0.92);
    display: none;
    /* 沒有鍵盤時維持原本置中的樣子。鍵盤跳出來的時候，JS 會在這個燈箱本身加上
       .keyboard-open 這個 class（見 header.php／notifications.php／index.php等
       的 focus/blur 處理），改成貼齊底部——卡片本身維持固定高度（不會跟著鍵盤
       縮小，見 .post-detail-inner／.post-iframe-inner），鍵盤跳出來時卡片多出來、
       被鍵盤吃掉的部分自然被推到畫面最上面看不到的地方，底部（含輸入框）貼齊
       鍵盤上緣，留言/對話串保留完整、寬裕的顯示空間；鍵盤收起來、拿掉這個
       class 之後就恢復原本置中 */
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 200;
    overflow: hidden;
}

.post-detail-modal.active {
    display: flex;
}

.post-detail-modal.keyboard-open {
    align-items: flex-end;
}

.post-detail-inner {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    padding: 2rem;
    max-width: 640px;
    max-height: 85vh;
    max-height: 85svh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.post-detail-scroll {
    overflow-y: auto;
    min-height: 0;
}

/* 「查看貼文」是 admin-reports.php 專用的燈箱，跟前台首頁「查看全部留言」共用
   同一套 .post-detail-* class，所以這裡刻意用 #admin-post-detail-modal 這個 id
   往下限定範圍，只調整 admin 這邊，不會連前台那邊也跟著變 */
#admin-post-detail-modal .post-detail-inner {
    padding: 1.75rem;
}

#admin-post-detail-modal .post-gallery {
    justify-content: center;
}

.post-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(10, 7, 12, 0.75);
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-iframe-inner {
    padding: 0;
    overflow: hidden;
    height: 85vh;
    height: 85svh;
}

.post-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: var(--surface);
}

.post-detail-close:hover {
    color: var(--accent-start);
}

.post-detail-caption {
    margin-top: 1rem;
    color: var(--text);
    font-size: 20px;
}

.post-detail-comments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hairline);
}

.admin-search {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

/* 這裡原本只寫 .admin-search-input，跟檔案後面的 .auth-input 權重一樣，
   後定義的 .auth-input 會贏，它的 margin-bottom: 1.25rem 蓋掉了這裡的 0。
   輸入框底下多出 20px 的外邊距，align-items: center 把「框 + 外邊距」一起置中，
   框本身就被往上推了 10px，看起來就是輸入框高、按鈕低。
   前面加上 .admin-search 提高權重，讓 margin-bottom: 0 真的生效 */
.admin-search .admin-search-input {
    margin-bottom: 0;
    flex: 1;
    max-width: 360px;
    box-sizing: border-box;
    height: 48px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 46px;
}

/* 跟 .comment-input / .comment-submit 同一套做法：把輸入框跟按鈕釘在同一個明確
   高度（48px），不靠 align-items 去猜兩邊預設高度剛好一樣——.auth-input 跟
   .admin-btn 的預設高度本來就不同（padding、line-height 來源不一樣），
   align-items: center 頂多讓兩個不同高度的「中心點」對齊，邊緣看起來還是會
   偏。兩邊都用同一個高度、同一個 box-sizing，中心點自然就是同一條線，
   不用再猜 margin-top 要調幾 px */
.admin-search .admin-btn {
    box-sizing: border-box;
    height: 48px;
    padding: 0 1.1rem;
    line-height: 48px;
    font-size: 0.85rem;
}

.admin-status-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin: 0.75rem 0;
}

/* .admin-status-select 跟 .admin-search-input 是同一個問題：margin-bottom: 0
   在這裡跟後面的 .auth-input 權重一樣，順序上後定義的 .auth-input 會贏，選單
   底下多出的 1.25rem 外邊距會被 align-items: center 一起算進去，選單看起來
   被往上推、跟右邊的勾選框／按鈕對不齊。用同一招處理：前面加上
   .admin-status-form 提高權重，並且比照 .admin-search-input 直接把高度釘死
   在 48px，不靠瀏覽器對 <select> 的預設樣式去猜 */
.admin-status-form .admin-status-select {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
    cursor: pointer;
    box-sizing: border-box;
    height: 48px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 46px;
}

/* 勾選框那個 label 原本用行內 style 自己置中內容，但沒有固定高度，跟旁邊
   選單／按鈕的高度對不上。跟另外兩個元素一樣釘死 48px，三個東西的中心點
   才會落在同一條線上 */
.admin-status-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0.75rem;
    font-size: 0.95rem;
    box-sizing: border-box;
    height: 48px;
}

/* 這顆「更新狀態」按鈕跟 .admin-search 那顆搜尋按鈕同一個問題：
   .admin-btn-reject 本身的 padding/line-height 撐出來的高度跟選單的 48px
   對不上。比照 .admin-search .admin-btn 的做法，一樣釘死在 48px */
.admin-status-form .admin-btn-reject {
    box-sizing: border-box;
    height: 48px;
    padding: 0 1.1rem;
    line-height: 48px;
    font-size: 0.85rem;
}

/* ---- 登入 / 註冊 / 密碼相關卡片 ---- */

.auth-wrap {
    max-width: 420px;
    margin: 4.5rem auto;
    padding: 0 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 24px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 30px 60px -25px rgba(185, 105, 245, 0.35);
}

.auth-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1.75rem;
}

.auth-error {
    background: rgba(255, 111, 111, 0.12);
    border: 1px solid rgba(255, 111, 111, 0.35);
    color: #ffb3b3;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}

.auth-note {
    background: rgba(255, 111, 156, 0.1);
    border: 1px solid rgba(255, 111, 156, 0.3);
    color: var(--text);
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    margin: 0 0 1.25rem;
    line-height: 1.6;
    word-break: break-all;
}

.policy-note {
    font-size: 1.05rem;
}

.messages-safety-note {
    font-size: calc(0.95rem + 1px);
}

.visually-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.media-picker {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-deep);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 0.7rem 0.95rem;
    margin-bottom: 1.25rem;
}

.media-picker-btn-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.media-picker-btn {
    display: inline-block;
    background: var(--text);
    color: #1a0f1c;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.media-picker-input-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.media-picker-status {
    color: var(--text-muted);
    font-size: 1rem;
    overflow-wrap: break-word;
    min-width: 0;
}

.auth-note a {
    color: var(--accent-start);
}

.auth-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: block;
}

label[for="media"] {
    font-size: 1rem;
}

.auth-input {
    background: var(--bg-deep);
    border: 1px solid var(--hairline);
    color: var(--text);
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    font-family: inherit;
    width: 100%;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px rgba(255, 111, 156, 0.18);
}

/* Chrome 自動填入預設會蓋成白底黑字，這裡強制蓋回我們自己的深色 */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-deep) inset;
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    transition: background-color 9999s ease-in-out 0s;
}

.auth-submit {
    background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
    color: #1a0f1c;
    border: none;
    padding: 0.85rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 0.5rem;
    width: 100%;
    display: block;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -8px rgba(255, 111, 156, 0.5);
}

.auth-submit-link {
    display: block;
    text-align: center;
    text-decoration: none;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

.auth-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--accent-start);
}

.auth-switch {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

.auth-switch a {
    color: var(--accent-start);
    text-decoration: none;
    font-weight: 600;
}

.password-field {
    position: relative;
    margin-bottom: 1.25rem;
}

.password-field .auth-input {
    margin-bottom: 0;
    padding-right: 4.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    padding: 0.3rem;
}

.password-toggle:hover {
    color: var(--accent-start);
}

/* ---- 管理後台 ---- */

.admin-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

.admin-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.admin-card-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1rem;
}

.admin-field {
    margin: 0.3rem 0;
    font-size: 0.95rem;
}

.admin-field strong {
    color: var(--text-muted);
    font-weight: 500;
}

.orphan-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.select-all-item {
    font-weight: 600;
    display: inline-flex;
}

.orphan-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}

.orphan-name {
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.orphan-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: auto;
}

/* 貼文紀錄頁字太小，手機版尤其明顯。這幾個 class 在孤兒檔案清理／清除退件舊照片
   等其他 admin 頁面也有用到，所以用 #post-history-wrap 往下限定範圍，只有這頁的
   文字放大 1px，不會連帶影響其他頁面 */
#post-history-wrap .admin-field {
    font-size: 16.2px;
}

#post-history-wrap .orphan-name {
    font-size: 15.4px;
}

#post-history-wrap .orphan-meta {
    font-size: 14.6px;
}

.admin-images {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.admin-thumb {
    display: block;
    width: 140px;
    height: 90px;
    max-width: 220px;
    max-height: 260px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
    border: 1px solid var(--hairline);
}

.admin-thumb-viewable {
    cursor: zoom-in;
}

.admin-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.admin-actions .admin-reject-label {
    width: 100%;
    margin-bottom: 0;
}

.admin-btn {
    background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
    color: #1a0f1c;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.admin-reject-block {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--hairline);
}

.admin-reject-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.admin-reason {
    width: 100%;
    margin-bottom: 0.6rem;
    resize: vertical;
    font-family: inherit;
}

.admin-btn-reject {
    background: transparent;
    color: var(--text-muted);
    /* 原本用 --hairline，太淡幾乎看不到，改成比較明顯的白色 */
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.admin-btn-reject:hover {
    color: var(--text);
    border-color: var(--accent-start);
}

.locked-notice {
    text-align: center;
    padding: 5rem 1rem;
}

.locked-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0 0 1.5rem;
}

.locked-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.locked-actions a {
    text-decoration: none;
    font-size: 0.95rem;
}

.locked-actions a:not(.nav-cta) {
    color: var(--text-muted);
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
}

.locked-actions a:not(.nav-cta):hover {
    color: var(--text);
    border-color: var(--accent-start);
}

@media (max-width: 480px) {
    .feed {
        padding: 2rem 1.25rem 4rem;
    }
    .auth-form {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    .post-detail-modal {
        padding: 0.5rem;
    }
    .post-detail-inner {
        padding: 1.25rem;
    }
}

/* 純文字按鈕的共用重置樣式：<button> 想看起來像普通文字連結時（不想要瀏覽器
   預設的邊框/底色），搭配 .post-report-link 或其他顏色類別一起用 */
.text-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* 會員大頭貼：貼文/留言作者名字旁邊的小圖示（.avatar-sm）、個人主頁最上方的
   大圖（.avatar-lg）。沒有設定大頭貼時用 .avatar-placeholder 顯示灰白色圓形
   佔位，不用另外準備預設圖檔。 */
.avatar-img,
.avatar-placeholder {
    display: inline-block;
    border-radius: 50%;
    vertical-align: middle;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-placeholder {
    background: #cfc9d1;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    margin-right: 0.4rem;
}

.avatar-lg {
    width: 96px;
    height: 96px;
}

/* 個人主頁最上方的大頭貼是用 <button> 包起來（點下去開燈箱看原圖），把瀏覽器
   預設的按鈕邊框/底色清掉，只留大頭貼本身的圓形外觀 */
.avatar-hero-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-block;
    border-radius: 50%;
}

/* 移除大頭貼的 × 徽章，疊在大頭貼右上角（外層容器要 position:relative） */
.avatar-remove-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--hairline);
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.avatar-remove-badge:hover {
    color: var(--accent-start);
}

/* 私訊收件匣列表：大頭貼＋帳號名字這塊要跟外層「打開對話串」的連結分開，
   自己另外連到個人主頁（見 messages.php 的 .conv-profile-link[data-href]） */
.conv-profile-link {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

/* 私訊聊天室裡的圖片/影片：原本這幾個 class 完全沒有樣式，圖片會用瀏覽器原生
   大小顯示（截圖看到的巨大圖片、版面被撐爆就是這樣來的）。統一限制縮圖大小，
   影片改成跟貼文相簿一樣「先放縮圖佔位，點下去才用燈箱播放」，不要在小小的
   聊天泡泡裡塞一個完整的 <video controls>（原生控制列在那麼窄的寬度下很難點）。 */
.thread-msg-media {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.thread-msg-media-item {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}

img.thread-msg-media-item.thread-msg-media-zoomable {
    cursor: zoom-in;
}

.thread-msg-video-thumb {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    cursor: pointer;
}

/* 私訊輸入框下方，選好要夾帶的圖片/影片後的清單：原本用實際圖片縮圖，容易跟
   聊天室裡的問題一樣爆版面，改成純文字（檔名）+ × 取消，跟大頭貼上傳那邊選好
   檔案後的呈現方式一致 */
.message-attach-row {
    margin-top: 0.5rem;
}

.message-attach-btn {
    display: inline-block;
    background: var(--text);
    color: #1a0f1c;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.message-attach-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.message-attach-preview-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-deep);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 0.4rem 0.5rem 0.4rem 0.9rem;
    font-size: 0.85rem;
    max-width: 100%;
}

.message-attach-preview-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.message-attach-preview-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.message-attach-preview-remove:hover {
    color: var(--accent-start);
}

.message-attach-error {
    margin-top: 0.5rem;
}

/* 私訊以燈箱呈現「單一對話」時的精簡版面（messages.php 的 .chat-embed）：
   警語、「回私訊列表」都不渲染，整個 html/body 撐滿 iframe 的高度，用直向 flex
   排列——頭像/名字固定在上面、輸入框跟附加檔案固定在下面，中間的訊息列表
   （.thread-list）撐滿剩下空間、自己捲動。這樣整個燈箱只有「訊息列表」這一個
   卷軸，不會變成 iframe 文件本身一個卷軸、裡面訊息列表又自己一個卷軸 */
html.chat-embed,
html.chat-embed body {
    height: 100%;
    margin: 0;
}

body.chat-embed {
    overflow: hidden;
}

body.chat-embed .auth-wrap {
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

body.chat-embed .auth-title {
    flex: 0 0 auto;
    margin-bottom: 0.75rem !important;
}

body.chat-embed .thread-list-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    margin-bottom: 0.75rem;
}

body.chat-embed .thread-list-wrap .thread-list {
    flex: 1 1 auto;
    max-height: none;
    margin-bottom: 0;
}

body.chat-embed #message-form {
    flex: 0 0 auto;
}

/* 對話串「查看新訊息」提示：使用者正在往上看舊訊息時，如果對方傳新訊息過來，
   不直接把畫面捲到底（那樣會打斷他正在看的內容），改成在對話串下方浮現這顆
   按鈕，點下去才捲到底。.thread-list-wrap 是這顆按鈕定位的參考基準，全頁版面
   跟燈箱版面都共用同一顆 */
.thread-list-wrap {
    position: relative;
}

.new-msg-banner {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #1a0f1c;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 2;
    white-space: nowrap;
}

.new-msg-banner:hover {
    opacity: 0.9;
}

/* 圖片/影片燈箱裡的上一張/下一張按鈕（跟貼文卡片裡相簿本身的 .gallery-nav
   是不同東西——這組是給「點開燈箱放大看」之後，在燈箱裡切換同一則貼文其他
   圖片/影片用的）。預設不顯示，只有一則貼文裡有兩個以上的圖片/影片時，
   JS 才會把它顯示出來。裡面放的是 SVG 箭頭圖示，不是文字符號，樣式更現代、
   跟系統字型的粗細/比例無關，不同裝置看起來都一致 */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(21, 15, 26, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.lightbox-nav:hover {
    background: rgba(21, 15, 26, 0.8);
    border-color: var(--accent-start);
}

.lightbox-nav-prev {
    left: 1rem;
}

.lightbox-nav-next {
    right: 1rem;
}

/* 燈箱裡「一張一張滑動切換」的相簿：用瀏覽器原生的橫向捲動＋scroll-snap 做，
   不是自己用 JS 算位移/動畫——原生捲動本來就很順，也不會有自訂動畫收尾時機
   沒對準、殘影這類問題。每一張（.lightbox-slide）固定佔滿整個容器寬度，
   捲到哪一張就會自動貼齊置中停住 */
.lightbox-track {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lightbox-track::-webkit-scrollbar {
    display: none;
}

.lightbox-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.lightbox-slide img,
.lightbox-slide video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* 相簿裡影片還沒點開播放前的縮圖佔位，跟貼文相簿、聊天室影片縮圖同一套
   純黑底＋播放鍵的視覺語言 */
.lightbox-video-thumb {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 8px;
    cursor: pointer;
}


/* 發表貼文頁面的草稿功能：「儲存草稿」次要按鈕，跟主要的「發表貼文」按鈕
   並排；草稿清單裡每一則草稿的卡片，點了會載入表單接著寫，右邊有刪除鈕 */
.compose-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.compose-actions .auth-submit {
    margin-top: 0;
    flex: 1;
}

.draft-save-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--hairline);
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: border-color 0.15s ease;
}

.draft-save-btn:hover {
    border-color: var(--accent-start);
}

.draft-save-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
    min-height: 1.2em;
}

.draft-list {
    margin-bottom: 1.5rem;
}

.draft-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.draft-item-active {
    border-color: var(--accent-start);
}

.draft-item-link {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--text);
    text-decoration: none;
}

.draft-item-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-start);
}

.draft-item-preview {
    font-size: 0.88rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.draft-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    flex-shrink: 0;
}

.draft-delete-btn:hover {
    color: #ffb3b3;
}

/* 通知／私訊清單上方的「全部已讀」按鈕，跟草稿功能的次要按鈕共用同一套
   外框樣式語言，維持視覺一致 */
.mark-all-read-btn {
    display: block;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--hairline);
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin: 0 0 1.25rem;
    transition: border-color 0.15s ease;
}

.mark-all-read-btn:hover {
    border-color: var(--accent-start);
}

.mark-all-read-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* [hidden] 這個屬性瀏覽器內建就是靠 display:none 隱藏，但上面 .mark-all-read-btn
   這個 class 本身也寫了 display:block——兩條規則的優先權（specificity）一樣高，
   排在後面（也就是這裡，作者自己的樣式表）的會贏，結果變成不管有沒有 hidden
   屬性都顯示成 block，hidden 完全失效。這裡用 [hidden] 這個屬性選擇器疊加在
   class 後面（.mark-all-read-btn[hidden]），優先權比單純的 .mark-all-read-btn
   高，才能真的蓋掉上面的 display:block、讓 hidden 屬性生效 */
.mark-all-read-btn[hidden] {
    display: none;
}

/* 個人頁面的「已封鎖的會員」清單——點按鈕展開/收合，裡面每一項重用草稿清單
   那組 .draft-item 系列樣式（同樣是「連結+一顆動作按鈕」的卡片），不用另外
   重寫一套 */
.blocked-list-wrap {
    margin-bottom: 1.5rem;
}

.blocked-list {
    margin-top: 0.75rem;
}

/* 個人頁面「已封鎖的會員」展開按鈕。以前是拿 .post-report-link 冒充純文字連結，但這顆是
   <button>，沒有清掉瀏覽器預設的淺灰底色，近白色的文字疊在淺灰底上幾乎看不清楚。
   改成有邊框的實心按鈕：文字用主要文字色、人數獨立做成漸層徽章、展開／收合有箭頭指示 */
.blocked-list-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid rgba(245, 236, 240, 0.3);
    border-radius: 999px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.blocked-list-toggle:hover {
    border-color: var(--accent-start);
    background: rgba(255, 111, 156, 0.12);
}

.blocked-list-toggle:focus-visible {
    outline: 2px solid var(--accent-start);
    outline-offset: 2px;
}

.blocked-list-toggle-count {
    min-width: 1.6rem;
    padding: 0.05rem 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: #1a0f1c;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.blocked-list-toggle::after {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
}

.blocked-list-toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg) translateY(-2px);
}

.blocked-list-hint {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-muted);
    opacity: 0.85;
}

/* 清單裡每一位：名字放大、換成主要文字色；「取消封鎖」從一行淡淡的字，改成有邊框的小按鈕 */
#blocked-modal .draft-item-preview {
    font-size: 1rem;
    color: var(--text);
}

#blocked-modal .unblock-btn {
    padding: 0.35rem 0.95rem;
    border: 1px solid rgba(245, 236, 240, 0.3);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
}

#blocked-modal .unblock-btn:hover {
    color: var(--text);
    border-color: var(--accent-start);
    background: rgba(255, 111, 156, 0.12);
}

#blocked-modal .unblock-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* 會員頁面的「封鎖這個會員」按鈕。這顆 <button> 一直只套用 .post-report-link（近白色的文字），
   沒有清掉瀏覽器預設的淺灰底色，手機上變成淺色字疊在淺灰底，幾乎看不到字。
   改成跟「已封鎖的會員」同一套風格：透明底加邊框的圓角按鈕、文字用主要文字色，
   前面加一個「禁止」圖示；滑過（手機上是按下）時整顆變成淡紅色，提示這是會影響對方的操作 */
.block-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.85rem;
    padding: 0.55rem 1.15rem;
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(245, 236, 240, 0.3);
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

/* 上面的 display 會蓋過瀏覽器對 hidden 屬性的預設隱藏，所以要另外補回來 */
.block-user-btn[hidden] {
    display: none;
}

.block-user-btn::before {
    content: '';
    box-sizing: border-box;
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: linear-gradient(to top right,
        transparent calc(50% - 1px), currentColor calc(50% - 1px),
        currentColor calc(50% + 1px), transparent calc(50% + 1px));
}

.block-user-btn:hover,
.block-user-btn:active {
    color: #ffd6dc;
    border-color: #ff8a9b;
    background: rgba(255, 90, 110, 0.14);
}

.block-user-btn:focus-visible {
    outline: 2px solid #ff8a9b;
    outline-offset: 2px;
}

.block-user-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* 個人頁面「封鎖的會員」燈箱。外殼沿用 .post-detail-modal／.post-detail-inner（跟「查看全部留言」同一套），
   這裡只補這個燈箱自己需要的部分 */

/* 這顆按鈕是「開燈箱」，不是「展開清單」，所以不要展開箭頭 */
.blocked-list-toggle.is-modal-trigger::after {
    content: none;
}

/* 這個燈箱裡的 hidden 一律要真的隱藏（.draft-item 等有自己的 display，會蓋過瀏覽器預設的 hidden 行為） */
#blocked-modal [hidden] {
    display: none !important;
}

/* 卡片高度不超過「燈箱外層的高度」：鍵盤跳出來時，JS 會把外層縮成畫面真正看得到的範圍，
   卡片跟著縮進去，最上面的標題跟搜尋框就不會被推到畫面外；清單在卡片裡自己捲動。
   （不支援 min() 的舊瀏覽器，會退回上一行的 85vh） */
#blocked-modal .post-detail-inner {
    max-height: 85vh;
    max-height: min(85svh, 100%);
    padding-bottom: 1.25rem;
}

/* 鍵盤跳出來、卡片比較矮的時候（清單只有幾位），卡片靠上，搜尋框停在畫面最上方，不會跳到鍵盤上緣 */
#blocked-modal.keyboard-open {
    align-items: flex-start;
}

.blocked-modal-title {
    margin: 0 2.5rem 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.blocked-modal-search {
    flex: none;
    margin-bottom: 1rem;
    -webkit-appearance: none;
    appearance: none;
}


/* ═══════════════════════════════════════════════════════════════════
   燈箱統一規格（放在檔案最後面，蓋過上面各處零散的設定）

   全站所有燈箱——卡片型（查看全部留言、私訊、通知裡的貼文、個人／留言頁面、封鎖名單、
   服務條款、裁剪大頭貼、後台查看貼文、後台私訊對話）跟看圖型（圖片影片放大、大頭貼放大）——共用同一套：

   1. 置中：燈箱外層四邊留一樣的邊（12px），卡片在正中間，上下左右對稱，沒有多餘的空白橫條。
   2. 卡片一樣大：寬最多 640px、高度佔滿（最高 900px）。
   3. 關閉 ×：在卡片「裡面」的右上角（距離卡片邊緣 10px），44×44。看圖型燈箱沒有卡片，
      × 放在同一個位置（浮在圖片上）。所以全站每一種燈箱，× 都在螢幕上同一個點。
   4. 卡片最上面留一條 64px 的空間給 ×，內容從它下面開始，不會被 × 蓋到。
   5. 燈箱裡面（iframe）的頁面不再自己畫 ×（html.site-embed），統一由最外層那顆負責：
      裡面如果開著放大的圖片，按 × 先關圖片，再按才關整張卡片（腳本在 lib.php）。
   6. 不拖動背景：燈箱開著時背景頁面被鎖住，燈箱上的滑動不會帶動後面的頁面（腳本在 lib.php 的共用燈箱程式）。
   想調整全站燈箱的大小、× 的位置，只要改下面這幾個數字。
   ═══════════════════════════════════════════════════════════════════ */
:root {
    --ov-margin: 12px;
    --ov-close-size: 44px;
    --ov-close-inset: 10px;
    --ov-card-width: 640px;
    --ov-card-height: 900px;
    /* 卡片最上面留給 × 的高度 */
    --ov-head: calc(var(--ov-close-size) + 2 * var(--ov-close-inset));
}

.post-detail-modal,
.lightbox {
    box-sizing: border-box;
    padding: calc(env(safe-area-inset-top, 0px) + var(--ov-margin)) var(--ov-margin) calc(env(safe-area-inset-bottom, 0px) + var(--ov-margin));
    align-items: center;
    justify-content: center;
    overscroll-behavior: contain;
}

/* 卡片：全站一樣大、置中。position:static 是為了讓裡面的 × 以「燈箱外層」為定位基準 */
.post-detail-inner,
.lightbox > .auth-form {
    position: static !important;
    box-sizing: border-box !important;
    width: min(var(--ov-card-width), 100%) !important;
    max-width: var(--ov-card-width) !important;
    height: min(100%, var(--ov-card-height)) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: var(--ov-head) 16px 16px !important;
    overscroll-behavior: contain;
}

.post-detail-inner {
    overflow: hidden;
}

.lightbox > .auth-form {
    overflow-y: auto;
}

/* 卡片裡面會捲動的區域：捲到頭不要帶動後面的頁面 */
.post-detail-scroll,
.thread-list,
.lightbox > .auth-form > .post-detail-scroll {
    overscroll-behavior: contain;
}

/* 服務條款卡片：標題固定、內文在卡片裡捲動 */
.lightbox > .auth-form > .post-detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* 裁剪大頭貼卡片：內容置中 */
#avatar-crop-modal > .auth-form {
    justify-content: center;
}

/* 卡片裡面是別的頁面（iframe）時：頁面貼滿卡片，只在最上面留 × 那一條 */
.post-iframe-inner {
    padding: var(--ov-head) 0 0 !important;
}

/* 關閉 ×：全站同一個位置——卡片的右上角（往內 10px）。
   top／right 用 max() 算出「卡片的角落」：手機上卡片貼近畫面邊緣，寬螢幕上卡片在中間（640px），× 跟著卡片走 */
.post-detail-close {
    position: absolute !important;
    top: max(calc(env(safe-area-inset-top, 0px) + var(--ov-margin) + var(--ov-close-inset)),
             calc(50% - var(--ov-card-height) / 2 + var(--ov-close-inset))) !important;
    right: max(calc(var(--ov-margin) + var(--ov-close-inset)),
               calc(50% - var(--ov-card-width) / 2 + var(--ov-close-inset))) !important;
    left: auto !important;
    bottom: auto !important;
    width: var(--ov-close-size) !important;
    height: var(--ov-close-size) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem !important;
    line-height: 1 !important;
    color: var(--text) !important;
    background: rgba(10, 7, 12, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 50% !important;
    cursor: pointer;
    z-index: 30 !important;
}

/* 燈箱開著時，背景頁面不要有任何回彈、連動捲動（鎖定本身由共用的燈箱程式做） */
html.site-overlay-open,
html.site-overlay-open body {
    overscroll-behavior: none;
}

/* 被嵌在燈箱（iframe）裡的頁面：自己的 × 不顯示，由最外層那顆負責（伺服器會在 <html> 標上 site-embed）。
   裡面的燈箱只需要留一圈小邊，卡片上方也不用再留 × 那一條 */
html.site-embed .post-detail-close {
    display: none !important;
}

html.site-embed .post-detail-modal,
html.site-embed .lightbox {
    padding: 8px;
}

html.site-embed .post-detail-inner,
html.site-embed .lightbox > .auth-form {
    padding: 16px !important;
}


/* ═══════════════════════════════════════════════════════════════════
   鍵盤跳出來時（點了燈箱裡的輸入框，例如留言框、私訊輸入框）

   卡片維持原本的高度、貼齊鍵盤上緣；多出來的頂部（連同 ×）移到畫面上方之外，
   讓對話內容有更多空間。做法：JS 把燈箱外層縮成「畫面真正看得到的範圍」並標上 keyboard-open
   （各頁自己的程式、疊加燈箱的程式都會），卡片的高度改用「沒有鍵盤時的畫面高度」（--ov-full-h，
   lib.php 的共用燈箱程式維護）算，比外層高的部分因為貼齊底部，自然溢到上方看不見的地方。
   × 改成跟著卡片走（一起移出畫面）；鍵盤收起來、拿掉 keyboard-open，就回到置中、× 在角落的樣子。
   ═══════════════════════════════════════════════════════════════════ */
.post-detail-modal.keyboard-open:not(#blocked-modal):not(#links-modal) .post-detail-inner {
    position: relative !important;
    flex: none;
    height: min(calc(var(--ov-full-h, 100vh) - 2 * var(--ov-margin) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)), var(--ov-card-height)) !important;
}

.post-detail-modal.keyboard-open:not(#blocked-modal):not(#links-modal) .post-detail-close {
    top: var(--ov-close-inset) !important;
    right: var(--ov-close-inset) !important;
}

/* 例外：個人頁面「封鎖的會員」燈箱，搜尋框在最上面——卡片要留在畫面裡、跟著縮小，
   搜尋框才不會被推到畫面外（維持原本的設計：貼齊上緣、高度不超過外層）。
   上面的規則用 :not(#blocked-modal) 把它排除，它繼續用統一規格的「高度不超過外層」。 */


/* ═══════════════════════════════════════════════════════════════════
   影片燈箱：影片不放到 × 底下

   iPhone 播放影片時，原生播放器的控制列（左上角全螢幕／子母畫面、右上角音量、底部進度條）是瀏覽器畫的，
   網站沒辦法搬動它們。影片如果一直撐到燈箱最上面，右上角的音量鍵就會跑到 × 底下、互相蓋住。
   改成：影片上下各留一排（--ov-head）的空白，× 在上面那一排、影片在正中間，兩邊的按鈕就不會疊在一起，上下空白也一樣多。
   只影響「影片」；圖片維持原本（× 是半透明圓形，浮在圖片角落沒有問題）。
   影片縮圖（點了才變成影片的那個佔位）跟影片用同一個範圍，切換時不會跳動。
   被嵌在卡片（iframe）裡的頁面不用留：卡片自己最上面那一排就是 ×，頁面從它下面開始。
   ═══════════════════════════════════════════════════════════════════ */
html:not(.site-embed) .lightbox-slide.lightbox-slide-video {
    box-sizing: border-box;
    padding-top: var(--ov-head);
    padding-bottom: var(--ov-head);   /* 下面留一樣多：影片上下的空白相等，正好在中間 */
}

/* 私訊頁自己的燈箱（單一支影片，不是相簿）：影片同樣上下各留一排 */
html:not(.site-embed) .lightbox #lightbox-video {
    max-height: calc(100% - 2 * var(--ov-head));
    margin-top: var(--ov-head);
    margin-bottom: var(--ov-head);
}

/* 影片一律依自己的長寬比顯示（不拉伸、不裁切）；縮圖佔位的大小由 lightbox 腳本依縮圖比例算出 */
.lightbox-slide video,
.lightbox #lightbox-video {
    object-fit: contain;
}


/* ═══════════════════════════════════════════════════════════════════
   貼文相簿：直式、橫式圖片放在一起時，比較矮的圖片（橫式照片會被縮到「寬度剛好放得進畫面」，
   高度就比直式照片矮）在垂直方向置中，不再貼齊上緣。相簿這一列的高度還是等於最高的那一張，沒有多出空白。
   影片佔位方塊跟直式照片一樣高，不受影響。
   ═══════════════════════════════════════════════════════════════════ */
.post-gallery {
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════
   手機：圖片／影片放大檢視器滿版

   手機（寬度 600px 以下，或手機橫放、高度 500px 以下）上，圖片／影片放大檢視器（#lightbox）：
   1. 四周不再留 --ov-margin 的邊
   2. 圖片、影片、影片縮圖不要圓角（圓角會在四個角露出底色，看起來就不是滿版）
   3. 影片不再「上下各預留一排」，也不再為底部控制列預留 124px；控制列改成浮在影片上
      （輕點影片就能隱藏控制列，這個行為本來就有）
   × 的位置不變（還是在右上角，浮在圖片／影片上）。電腦版（寬螢幕）完全不受影響。
   只針對 #lightbox（圖片／影片檢視器）；大頭貼放大、裁剪大頭貼、服務條款等其他燈箱不動。
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 600px), (max-height: 500px) {
    #lightbox.lightbox {
        padding: 0;
    }

    #lightbox .lightbox-img,
    #lightbox .lightbox-slide img,
    #lightbox .lightbox-slide video,
    #lightbox .lightbox-video-thumb {
        border-radius: 0;
    }

    #lightbox .lightbox-slide.lightbox-slide-video {
        padding-top: 0;
        padding-bottom: 0;
    }

    #lightbox #lightbox-video {
        margin-top: 0;
        margin-bottom: 0;
        max-height: 100%;
    }

    /* 私訊（用 iframe 嵌在卡片裡）：裡面的圖片／影片檢視器開著的時候，外層卡片撐滿整個畫面，
       不然檢視器最大只能到「卡片扣掉最上面那條 × 的高度」。lib.php 的私訊燈箱收到私訊頁
       通知（site-chat-media-lightbox）時，會在 #messages-modal 上加 / 拿掉 .media-fullscreen */
    #messages-modal.media-fullscreen {
        padding: 0;
    }

    #messages-modal.media-fullscreen .post-iframe-inner {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
}

/* 影片控制列藏起來時，× 跟左右箭頭也一起藏（lib.php 在燈箱外層加／拿掉 .lb-chrome-hidden；
   燈箱被嵌在卡片（iframe）裡時，外層那顆 × 由 lib.php 加／拿掉 .media-chrome-hidden 來藏） */
.lightbox > .post-detail-close {
    transition: opacity 0.25s ease;
}

.lightbox > .lightbox-nav {
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.25s ease;
}

.post-detail-modal .post-detail-close {
    transition: opacity 0.25s ease;
}

.lightbox.lb-chrome-hidden > .post-detail-close,
.lightbox.lb-chrome-hidden > .lightbox-nav,
.post-detail-modal.media-chrome-hidden .post-detail-close {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 私訊聊天室：影片縮圖照原本的長寬比顯示（不再是 150×150 正方形）
   有縮圖的影片（.has-thumb，裡面是真的 <img>）：最大 200×200，直式就是高 200、橫式就是寬 200，
   不裁切。手機較窄時寬度上限再依螢幕縮小（48vw），不會超出泡泡。
   沒有縮圖的影片（舊訊息、縮圖產生失敗）維持原本的黑色方塊。 */
.thread-msg-video-thumb.has-thumb {
    position: relative;
    display: block;
    width: auto;
    height: auto;
    overflow: hidden;
}

.thread-msg-video-thumb-img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(200px, 48vw);
    max-height: 200px;
    pointer-events: none;   /* 點擊、長按都落在外層方塊上（不會跳出「儲存圖片」選單） */
}

.thread-msg-video-thumb.has-thumb .video-lazy-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 影片播放器下方的控制列卡片：淡灰色（不太透明）。全站共用這一個規則。
   想再淡或再深，只改最後一個數字（不透明度，越大越不透明）。 */
.site-lb-bar {
    background: rgba(125, 125, 133, 0.72);
}

/* 私訊：對方是新帳號（註冊不到 14 天）的提醒。
   放在對話最上面（對方名字下面）。天數的門檻在 index.php 的 MSG_NEW_ACCOUNT_DAYS。 */
.new-account-note {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.8rem;
    background: rgba(255, 196, 87, 0.12);
    border: 1px solid rgba(255, 196, 87, 0.4);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* 以燈箱呈現的單一對話（.chat-embed）：整頁是直向排列，這一條固定高度、不被壓縮，
   訊息列表照樣撐滿剩下的空間 */
body.chat-embed .new-account-note {
    flex: 0 0 auto;
}

/* ── 必填欄位標記（註冊頁）──
   用 ::after 加在 label 後面，不改動 label 的文字，
   所以 register.php 裡用 textContent 切換「電話／工作室電話」時星號不會被洗掉。
   第二行 content 的「/ ""」是給螢幕閱讀器的替代文字（空字串＝不念出星號；
   欄位本身已有 required，會被讀成「必填」）；不支援的舊瀏覽器會自動用第一行。 */
.auth-label.is-required::after {
    content: " *";
    content: " *" / "";
    color: var(--accent-start);
    font-weight: 600;
}

.auth-required-note {
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-required-note .req-mark {
    color: var(--accent-start);
    font-weight: 600;
}

/* 會員自己輸入的文字（貼文、留言、通知、私訊、後台檢視）如果有一長串沒有空格的內容（例如完整網址），
   以前不會換行，會一路撐出卡片、被畫面邊緣切掉。這裡讓它在容器邊緣自動換行。
   overflow-wrap 只在「一整段放不下」時才會拆字，一般文字、中文的排版完全不受影響。
   先寫 break-word 當舊瀏覽器的備案，再用 anywhere：它連 flex 子項目的最小寬度都會一起算進去，才縮得進去 */
.post-caption,
.post-detail-caption,
.comment-text,
.comment-quote-text,
.reply-quote-preview-text,
.notif-reply,
.notif-parent,
.thread-msg-text,
.report-caption-text,
.admin-field {
    overflow-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* flex 裡的文字要允許縮小，不然會被自己的最小寬度撐住 */
.comment-text,
.reply-quote-preview-text {
    min-width: 0;
}

/* 很長的帳號名稱（最多 30 字、中間沒有空格）：貼文作者、使用者頁標題可以換行；
   通知那一列放不下時整個項目換到下一行，不要超出卡片 */
.post-author,
.user-profile-name {
    overflow-wrap: anywhere;
}

.notif-line {
    flex-wrap: wrap;
}

/* 通知那一列的帳號名稱原本設定不換行（.comment-author）；名稱長到一整行都放不下時，允許在名稱中間換行 */
.notif-line .comment-author {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* 網站名稱（頁首左上角）：改成中文名稱之後比英文長，頁首選單多的時候（後台、會員頁在平板寬度）
   會把名稱擠成兩三行。讓名稱永遠一行、不被壓縮，放不下的部分由旁邊的選單自己換行 */
.wordmark {
    white-space: nowrap;
    flex-shrink: 0;
}

/* 選單文字空間不夠時，整個項目換到下一行，不要把「發表貼文」這種項目從中間拆成兩行 */
.site-nav a,
.nav-user {
    white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════════
   「我的連結」
   - 個人頁面的燈箱 #links-modal：外殼沿用 .post-detail-modal／.post-detail-inner（跟 #blocked-modal 同一套）
   - 別人的個人頁面上的連結列表 .member-links
   - 「即將離開本站」中繼頁 .out-card
   ═══════════════════════════════════════════════════════════════════ */

/* 這個燈箱裡的 hidden 一律要真的隱藏（.draft-item 等有自己的 display，會蓋過瀏覽器預設的 hidden 行為） */
#links-modal [hidden] {
    display: none !important;
}

#links-modal .post-detail-inner {
    max-height: 85vh;
    max-height: min(85svh, 100%);
    padding-bottom: 1.25rem;
}

/* 鍵盤跳出來時，卡片靠上，輸入框停在畫面最上方，不會跳到鍵盤上緣 */
#links-modal.keyboard-open {
    align-items: flex-start;
}

.links-form {
    margin: 0 0 1.25rem;
}

.links-form-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.links-form .auth-label {
    margin-top: 0.6rem;
}

.links-form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.links-form-actions .auth-submit {
    width: auto;
    margin-top: 0;
    padding-left: 1.8rem;
    padding-right: 1.8rem;
}

.link-item {
    align-items: flex-start;
}

.link-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.link-item-title {
    max-width: 100%;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.link-item-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-item-host {
    max-width: 100%;
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.link-badge {
    padding: 0.05rem 0.65rem;
    border: 1px solid rgba(245, 236, 240, 0.3);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.link-badge-pending {
    color: #ffd9a0;
    border-color: rgba(255, 217, 160, 0.5);
}

.link-badge-blocked {
    color: #ffb3b3;
    border-color: rgba(255, 179, 179, 0.5);
}

.link-reason {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.link-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex-shrink: 0;
}

/* 別人的個人頁面：「對方的連結」按鈕 + 燈箱（按鈕沿用 .blocked-list-toggle，燈箱外殼沿用 .post-detail-modal） */
.member-links-wrap {
    max-width: 640px;
    margin: 0.5rem auto 1.5rem;
    text-align: center;
}

#member-links-modal [hidden] {
    display: none !important;
}

#member-links-modal .post-detail-inner {
    max-height: 85vh;
    max-height: min(85svh, 100%);
    padding-bottom: 1.25rem;
}

.member-link-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.8rem 0.95rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
}

.member-link-row:hover,
.member-link-row:focus-visible {
    border-color: var(--accent-start);
    background: rgba(255, 111, 156, 0.12);
}

.member-link-row-title {
    max-width: 100%;
    font-size: 1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.member-link-row-host {
    max-width: 100%;
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

/* 「即將離開本站」中繼頁 */
.out-card {
    text-align: center;
}

.out-from {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.out-label {
    margin: 0 0 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.out-host {
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    word-break: break-all;
}

.out-url {
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
    word-break: break-all;
}

.out-back-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.75rem;
    padding: 0.8rem;
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(245, 236, 240, 0.3);
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}

.out-back-btn:hover {
    border-color: var(--accent-start);
    background: rgba(255, 111, 156, 0.12);
}


/* ═══════════════════════════════════════════════════════════════════
   「我的連結」第二階段：中繼頁的檢舉、後台「連結管理」
   ═══════════════════════════════════════════════════════════════════ */

/* 中繼頁裡的 hidden 一律要真的隱藏（.auth-error 等有自己的 display，會蓋過瀏覽器預設的 hidden 行為） */
.out-card [hidden] {
    display: none !important;
}

.out-report {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hairline);
    text-align: center;
}

.out-report-toggle {
    background: transparent;
    border: none;
    padding: 0.3rem 0.5rem;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.out-report-toggle:hover {
    color: var(--text);
}

.out-report-form {
    margin-top: 0.75rem;
    text-align: left;
}

.out-report-form .auth-submit {
    margin-top: 0.75rem;
}

.out-report .auth-note {
    margin: 0.75rem 0 0;
    text-align: left;
}

/* 後台：連結管理 */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.admin-tab {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(245, 236, 240, 0.3);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.9rem;
    text-decoration: none;
}

.admin-tab:hover {
    border-color: var(--accent-start);
}

.admin-tab.is-active {
    border-color: var(--accent-start);
    background: rgba(255, 111, 156, 0.18);
    font-weight: 600;
}

.admin-link-host {
    font-size: 1.05rem;
    font-weight: 600;
    word-break: break-all;
}

.admin-link-url {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
}

.admin-link-reports {
    margin-top: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--hairline);
    border-radius: 10px;
}

.admin-link-report {
    margin: 0.4rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.admin-more {
    margin-top: 0.9rem;
}

.admin-more summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-more .admin-actions form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    align-items: flex-start;
}

.admin-link-reason {
    margin: 0;
}

.admin-blocked-domain {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--hairline);
}

.admin-blocked-domain > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}


/* ═══════════════════════════════════════════════════════════════════
   後台：文字連結一律用白色（不要瀏覽器預設的藍色／紫色）

   admin.php 的 admin_page_open() 會在 <body> 加上 class="is-admin"。
   用 :where() 把這條規則的權重壓到最低（只比瀏覽器預設高），所以：
   - 沒有 class 的普通 <a>（例如會員名稱連結）→ 白色
   - 有自己 class 的連結（.admin-btn、.admin-tab、.post-report-link、.auth-note a ……）→ 照原本的顏色
   以後後台新增的連結不用再另外設顏色。想改顏色，只要改這一行。
   ═══════════════════════════════════════════════════════════════════ */
:where(.is-admin) a {
    color: var(--text);
}


/* ═══════════════════════════════════════════════════════════════════
   後台手機版：上方工具列文字比前台小一號

   後台的選單項目很多（十幾個），手機上會折成四行，佔掉不少畫面高度，壓縮到下方內容。
   所以只有後台（body.is-admin）、螢幕寬 480px 以下：
   - 選單文字從 1.1rem 縮成 0.95rem（跟電腦版後台一樣大）
   - 工具列上下留白、行距稍微縮小
   前台（會員看的頁面）不受影響。要再調整大小，只改下面的 font-size。
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .is-admin .site-header {
        padding: 0.8rem 1.1rem;
        row-gap: 0.35rem;
    }

    .is-admin .site-nav a,
    .is-admin .nav-user {
        font-size: 0.95rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   後台上方功能列：目前所在的頁面，用深灰底膠囊包起來

   admin.php 的 admin_page_open() 會在「現在這一頁」對應的連結加上 class="is-current"。
   - 底色 #4a4a4a、文字白色：對比約 8.9:1（WCAG AAA 要求 7:1），一眼就能辨識
   - 細邊框用來襯出膠囊的輪廓（深灰底在深紫色頁面背景上，單靠底色比較不明顯）
   要換顏色，只改 background 和 border-color 這兩個。
   ═══════════════════════════════════════════════════════════════════ */
.is-admin .site-nav a.is-current {
    background: #4a4a4a;
    color: #fff;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .is-admin .site-nav a.is-current {
        padding: 0.2rem 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   私訊聊天室：對話卡片的留白縮小、帳號那一行字體縮小
   （想調整數字就改這一段，想還原就整段刪掉）
   ═══════════════════════════════════════════════════════════════════ */

/* 白色（自己）和灰色（對方）對話卡片的內距。
   原本 0.6rem 0.9rem（上下 9.6px、左右 14.4px）。
   第一個數字＝上下、第二個數字＝左右，想更緊就調小、想鬆一點就調大。 */
.thread-msg {
    padding: 0.35rem 0.65rem;
}

/* 卡片裡最下面那行時間：原本整行被撐成 25.6px 高（比字本身 12.8px 高了一倍），
   看起來像文字跟時間中間空了一大塊。改成獨立一行、行高 1.3，只影響私訊卡片裡的時間 */
.thread-msg .comment-time {
    display: block;
    line-height: 1.3;
}

/* 對話頁最上面「頭像＋帳號＋🌟已認證」那一行：原本 32px，改成 30px（小 2px）。
   🌟已認證會跟著帳號字體等比例縮小。只作用在這一行，其他頁面的標題不受影響 */
.auth-title .conv-profile-link {
    font-size: 30px;
}

/* ═══════════════════════════════════════════════════════════════════
   私訊燈箱（點某人對話跳出來的那個視窗）：把上面和下面多餘的空白收掉，
   讓中間的對話列表（那個框框）變高、一次看到更多對話
   - 全部只作用在 body.chat-embed（就是這個燈箱裡的聊天室），整頁版的私訊、
     其他頁面、其他燈箱都不受影響。
   - 燈箱最上面那一條放 × 的 64px 是全站燈箱統一的規格，這裡沒有動它。
   想調整就改下面的數字；想還原就把這一整段刪掉。
   ═══════════════════════════════════════════════════════════════════ */

/* 聊天室四周的內距：原本上下左右都是 1rem（16px）。上面 16→4px、下面 16→12px，左右不變 */
body.chat-embed .auth-wrap {
    padding: 0.25rem 1rem 0.75rem;
}

/* 頭像＋帳號那一行：原本行高繼承 1.6，那一行被撐得很高；改 1.25。下面的空白 12→8px */
body.chat-embed .auth-title {
    line-height: 1.25;
    margin-bottom: 0.5rem !important;
}

/* 「對方是新帳號」提醒：文字大小不變，只收緊上下的內距、行距跟下面的空白 */
body.chat-embed .new-account-note {
    padding: 0.4rem 0.7rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* 對話列表那個框框：框框裡面的上下左右內距 16/12px → 8px，框框跟下面輸入框的距離 12→8px */
body.chat-embed .thread-list-wrap {
    margin-bottom: 0.5rem;
}

body.chat-embed .thread-list-wrap .thread-list {
    padding: 0.5rem;
}

/* ── 下面的輸入框／送出／夾帶按鈕 ── */

/* 輸入框那一列跟對話列表之間，原本多空 16px，拿掉（上面已經有 8px 的距離） */
body.chat-embed #message-form .comment-form {
    margin-top: 0;
}

/* 輸入框：高度 48 → 44px（還是夠大好點、字還是 16px 所以 iPhone 不會自動放大畫面）。
   另外它底下原本有 20px 的空白（被別的規則蓋回來的），那是輸入框跟夾帶按鈕之間空太大的原因，拿掉 */
body.chat-embed #message-form .comment-input {
    margin-bottom: 0;
    height: 44px;
    line-height: 40px;
}

/* 送出：高度跟輸入框一樣 44px。原本的 top:-9px 是為了抵銷上面那 20px 空白才加的，
   空白拿掉之後這個要歸零，不然按鈕會比輸入框高一截 */
body.chat-embed #message-form .comment-submit {
    top: 0;
    height: 44px;
    line-height: 42px;
}

/* 夾帶圖片／影片：跟輸入框那一列保持 12px 的距離（不要貼太近以免誤觸），按鈕本身高度 37→34px */
body.chat-embed .message-attach-row {
    margin-top: 0.75rem;
}

body.chat-embed .message-attach-btn {
    padding: 0.35rem 0.8rem;
}

/* 還沒選檔案的時候，預覽清單是空的但仍佔 8px 的空白，空的時候不佔位（選了檔案就恢復） */
body.chat-embed .message-attach-previews:empty {
    margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   後台「會員查詢」：每位會員預設收成一列，點開才看到內容；
   裡面的 IP、個人資料、發文限制、已認證各自再收合。按鈕統一大小、間距。
   （想還原就把這一整段刪掉）
   ═══════════════════════════════════════════════════════════════════ */

/* 會員卡片：收起來時只佔一小塊，所以內距、間距比一般後台卡片小 */
.admin-member-card {
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.9rem;
}

/* 卡片的標題列（會員名稱、Email、狀態小標籤）：點它就展開／收合 */
.admin-member-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 44px;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.admin-member-summary::-webkit-details-marker,
.admin-fold-sub > summary::-webkit-details-marker {
    display: none;
}

.admin-member-summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 auto;
}

/* 原本卡片標題底下留 1rem，放進標題列之後不需要 */
.admin-member-summary .admin-card-head {
    margin-bottom: 0;
}

/* Email 跟註冊時間那一行：原本跟名字一樣大（20px），收合列上縮小到 0.9rem，才不會佔三四行 */
.admin-member-summary .post-time {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

/* 右邊的小箭頭：收起來朝下、展開朝上 */
.admin-member-summary::after,
.admin-fold-sub > summary::after {
    content: "";
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    margin: 0 0.35rem 0.3rem 0;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.admin-member-fold[open] > .admin-member-summary::after,
.admin-fold-sub[open] > summary::after {
    transform: rotate(-135deg);
    margin-bottom: -0.1rem;
}

/* 展開之後，標題列跟下面的內容中間畫一條線隔開 */
.admin-member-fold[open] > .admin-member-summary {
    padding-bottom: 0.8rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--hairline);
}

/* 標題列上的小標籤：狀態、已認證、管理員 */
.admin-member-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-tag {
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 0.1rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: var(--text);
    white-space: nowrap;
}

.admin-tag-verified {
    border-color: rgba(255, 196, 87, 0.6);
}

/* 卡片裡面的小區塊（IP 紀錄、個人資料、發文與上傳限制、已認證標章） */
.admin-fold-sub {
    margin: 0.7rem 0 0;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.admin-fold-sub[open] {
    padding-bottom: 0.9rem;
}

.admin-fold-sub > summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 0.9rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.95rem;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}

/* 標題右邊的小字（例如「已認證中」「預設」），跟箭頭一起靠右 */
.admin-fold-hint {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

.admin-fold-sub > :not(summary) {
    margin-left: 0.9rem;
    margin-right: 0.9rem;
}

/* 區塊標題已經寫了「IP 紀錄」「個人資料」，裡面原本那個標題字（以及它後面的換行）就不重複顯示 */
.admin-fold-sub > .admin-field:first-of-type > strong:first-child,
.admin-fold-sub > .admin-field:first-of-type > strong:first-child + br {
    display: none;
}

/* 發文限制、已認證這兩個表單放進區塊之後，原本自己的上方分隔線與間距不需要了 */
.admin-fold-sub > form {
    margin-top: 0.4rem !important;
    padding-top: 0 !important;
    border-top: 0 !important;
}

/* 會員卡片裡所有按鈕：同樣大小（高 48px、最小寬 8.75rem、字 0.85rem；48px 跟旁邊的狀態下拉選單、搜尋框一樣高）、同樣間距（右、下各 0.6rem）。
   原本有的按鈕行內寫了 margin-left，所以這裡的 margin 要加 !important 才蓋得過去 */
.admin-member-fold .admin-btn,
.admin-member-fold .admin-btn-reject {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8.75rem;
    height: 48px;
    padding: 0 0.9rem;
    margin: 0 0.6rem 0.6rem 0 !important;
    font-size: 0.85rem;
    line-height: 1;
    vertical-align: top;
}

/* 「更新狀態」那一列本身就是 flex 加 gap，按鈕不用再加外距 */
.admin-member-fold .admin-status-form .admin-btn-reject {
    margin: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   大頭貼＋帳號那一行：整站統一「中線橫向對齊」
   原因：大頭貼用 vertical-align: middle，只會對齊到英文小寫字的中間，遇到中文字、
   🌟已認證／🐰管理員 這種比較高的字，文字就會比大頭貼的中線高 1~3px；通知列則是
   用 baseline（文字底線）對齊，大頭貼整個浮高約 8~9px。
   做法：這幾處改成橫向排列（flex）並上下置中，頭像、帳號、標章三者共用同一條中線。
   頭像和名字之間原本靠一個空格撐出的距離，用 calc 補回去，看起來間距不變。
   想還原就把這一整段（到「—— 置中結束 ——」為止）刪掉。
   ═══════════════════════════════════════════════════════════════════ */

/* 貼文標頭（首頁、貼文頁、個人頁、燈箱）：作者那一格橫向置中；
   標頭本身也上下置中，右邊的日期才不會對齊頭像的底邊 */
.post-meta {
    align-items: center;
}

.post-meta .post-author {
    display: flex;
    align-items: center;
}

.post-meta .post-author .avatar-sm {
    margin-right: calc(0.4rem + 0.25em);
}

.post-meta .post-author .post-status-badge {
    margin-left: calc(0.5rem + 0.25em);
}

/* 留言（貼文頁、燈箱）：名字那一格橫向置中 */
.comment-line > a.comment-author {
    display: flex;
    align-items: center;
}

.comment-line > a.comment-author .avatar-sm {
    margin-right: calc(0.4rem + 0.25em);
}

/* 通知列：大頭貼原本跟文字底線對齊（浮得太高），改成跟這一列上下置中。
   旁邊的帳號、「在你的貼文留言」維持原本的底線對齊 */
.notif-line > .avatar-img,
.notif-line > .avatar-placeholder {
    align-self: center;
}
/* —— 置中結束 —— */