
/*
 * Sealove Style21 - ForumDisplay Gold
 * 板塊列表頁專用樣式
 * 只作用於 body.pg_forumdisplay，不影響首頁、帖子頁與 canonical / H1。
 */

body.pg_forumdisplay {
    --fd-gold-1: #f7e7a6;
    --fd-gold-2: #e6c85e;
    --fd-gold-3: #b28a1e;
    --fd-gold-4: #7a5a12;
    --fd-line: #ead8a0;
    --fd-paper: rgba(255,255,255,.94);
    --fd-soft: #fffaf0;
    --fd-text: #28251f;
    --fd-muted: #80786d;
}

/* ===== 板塊導讀卡 ===== */
body.pg_forumdisplay .bml {
    border: 1px solid var(--fd-line) !important;
    border-radius: 18px !important;
    background:
        radial-gradient(circle at 100% 0, rgba(244,221,139,.27), transparent 36%),
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,250,237,.96)) !important;
    box-shadow: 0 12px 30px rgba(93,68,13,.08) !important;
    overflow: hidden;
}

body.pg_forumdisplay .bml .bm_h {
    min-height: auto !important;
    padding: 24px 28px 14px !important;
    border: 0 !important;
    background: transparent !important;
}

body.pg_forumdisplay .bml .bm_h h1 {
    color: var(--fd-text) !important;
    font-size: 28px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
}

body.pg_forumdisplay .bml .bm_h h1 a {
    color: inherit !important;
    text-decoration: none !important;
}

body.pg_forumdisplay .bml .bm_h h1 .xs1 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 12px;
    color: var(--fd-muted) !important;
    font-size: 13px !important;
}

body.pg_forumdisplay .bml .bm_h .y a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 6px 6px;
    padding: 0 13px;
    border: 1px solid var(--fd-line);
    border-radius: 999px;
    background: rgba(255,255,255,.76);
    color: #705315 !important;
    text-decoration: none !important;
}

body.pg_forumdisplay .bml .bm_c {
    padding: 0 28px 24px !important;
    border: 0 !important;
    color: #625c52;
    font-size: 15px;
    line-height: 1.85;
}

/* ===== 發表新內容與返回 ===== */
body.pg_forumdisplay #pgt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0 14px !important;
}

body.pg_forumdisplay #newspecial {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 150px;
    height: 46px !important;
    padding: 0 22px;
    border: 1px solid #c99f28;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7df75, #d6aa26);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 7px 16px rgba(143,101,12,.16);
    color: #35280c !important;
    font-size: 16px;
    font-weight: 800;
    text-indent: 0 !important;
    text-decoration: none !important;
}

body.pg_forumdisplay #newspecial img {
    display: none !important;
}

body.pg_forumdisplay #newspecial::before {
    content: "發表新內容";
}

body.pg_forumdisplay .pgb a {
    height: 42px;
    line-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--fd-line);
    border-radius: 11px;
    background: #fff;
    color: #6e5318 !important;
    text-decoration: none !important;
}

/* ===== 類型與篩選標籤 ===== */
body.pg_forumdisplay #thread_types,
body.pg_forumdisplay #threadlist .th {
    border: 1px solid var(--fd-line) !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,.92) !important;
    box-shadow: 0 8px 20px rgba(97,71,12,.05);
}

body.pg_forumdisplay #thread_types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px !important;
}

body.pg_forumdisplay #thread_types li {
    float: none !important;
    margin: 0 !important;
    border: 0 !important;
}

body.pg_forumdisplay #thread_types li a,
body.pg_forumdisplay #threadlist .tf a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px !important;
    border: 1px solid var(--fd-line);
    border-radius: 999px;
    background: #fffdf8;
    color: #66501d !important;
    font-weight: 600;
    text-decoration: none !important;
}

body.pg_forumdisplay #thread_types li.a a,
body.pg_forumdisplay #threadlist .tf a[style*="font-weight:bold"] {
    border-color: #d3aa36;
    background: linear-gradient(180deg, #fae99c, #e7c458);
    color: #34270c !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

body.pg_forumdisplay #threadlist .th {
    margin: 14px 0 !important;
    padding: 12px 15px !important;
}

body.pg_forumdisplay #threadlist .th table,
body.pg_forumdisplay #threadlist .th tbody,
body.pg_forumdisplay #threadlist .th tr,
body.pg_forumdisplay #threadlist .th th {
    display: block !important;
    width: auto !important;
}

body.pg_forumdisplay #threadlist .th td.by,
body.pg_forumdisplay #threadlist .th td.num {
    display: none !important;
}

body.pg_forumdisplay #threadlist .tf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 0 !important;
    color: #776f65;
}

/* ===== 主題列表改為內容卡片 ===== */
body.pg_forumdisplay #threadlist {
    border: 0 !important;
    background: transparent !important;
}

body.pg_forumdisplay #threadlist > .bm_c {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.pg_forumdisplay #threadlisttableid {
    display: block !important;
    width: 100% !important;
    border-collapse: separate !important;
}

body.pg_forumdisplay #threadlisttableid > tbody {
    display: block !important;
    position: relative;
    margin: 0 0 16px;
    border: 1px solid var(--fd-line);
    border-radius: 18px;
    background: var(--fd-paper);
    box-shadow: 0 10px 24px rgba(89,65,12,.06);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.pg_forumdisplay #threadlisttableid > tbody:hover {
    transform: translateY(-2px);
    border-color: #d8b34b;
    box-shadow: 0 15px 32px rgba(89,65,12,.10);
}

body.pg_forumdisplay #threadlisttableid > tbody.emptb,
body.pg_forumdisplay #threadlisttableid > tbody#separatorline {
    display: none !important;
}

body.pg_forumdisplay #threadlisttableid > tbody > tr {
    display: grid !important;
    grid-template-columns: 190px minmax(0, 1fr) 112px 88px;
    min-height: 154px;
}

body.pg_forumdisplay #threadlisttableid td,
body.pg_forumdisplay #threadlisttableid th {
    box-sizing: border-box;
    border: 0 !important;
}

/* 左側縮圖區 */
body.pg_forumdisplay #threadlisttableid td.icn {
    display: flex !important;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
    grid-column: 1;
    grid-row: 1;
    width: auto !important;
    padding: 14px !important;
    background-color: #f1ede4;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.pg_forumdisplay #threadlisttableid td.icn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 56%, rgba(255,255,255,.16));
    pointer-events: none;
}

body.pg_forumdisplay #threadlisttableid td.icn > a {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

body.pg_forumdisplay #threadlisttableid td.icn img {
    max-width: 20px !important;
    max-height: 20px !important;
}

/* 不同主題自動使用不同 fallback，避免一整頁重複 */
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+1) td.icn { background-image: url("/webp/nightlife-career.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+2) td.icn { background-image: url("/webp/business-drink.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+3) td.icn { background-image: url("/webp/pro-hostess-career.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+4) td.icn { background-image: url("/webp/luxury-box.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+5) td.icn { background-image: url("/webp/part-time-job.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+6) td.icn { background-image: url("/webp/vip-room..webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+7) td.icn { background-image: url("/webp/job-hiring.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+8) td.icn { background-image: url("/webp/private-lounge.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+9) td.icn { background-image: url("/webp/safety-guide.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+10) td.icn { background-image: url("/webp/premium-spirits.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+11) td.icn { background-image: url("/webp/consultation.webp"); }
body.pg_forumdisplay #threadlisttableid > tbody:nth-of-type(12n+12) td.icn { background-image: url("/webp/ktv-lounge.webp"); }

/* 內容主欄 */
body.pg_forumdisplay #threadlisttableid th {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 24px 26px !important;
    background: transparent !important;
}

body.pg_forumdisplay #threadlisttableid th > a.s.xst,
body.pg_forumdisplay #threadlisttableid th > a.xst {
    display: block;
    color: var(--fd-text) !important;
    font-size: 20px !important;
    line-height: 1.55 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

body.pg_forumdisplay #threadlisttableid th > a.s.xst:hover,
body.pg_forumdisplay #threadlisttableid th > a.xst:hover {
    color: #9a7215 !important;
}

body.pg_forumdisplay #threadlisttableid th::after {
    content: none !important;
    display: none !important;
}

body.pg_forumdisplay #threadlisttableid .res-ti {
    order: 3;
    margin-top: 8px !important;
    color: #999186 !important;
    font-size: 13px !important;
}

body.pg_forumdisplay #threadlisttableid .tdpre,
body.pg_forumdisplay #threadlisttableid .showcontent,
body.pg_forumdisplay #threadlisttableid .showhide {
    opacity: .3;
}

/* 作者與統計弱化，減少論壇感 */
body.pg_forumdisplay #threadlisttableid td.by,
body.pg_forumdisplay #threadlisttableid td.num {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-left: 1px solid #eee2bd !important;
    color: #8a8174;
    background: rgba(255,253,248,.54);
}

body.pg_forumdisplay #threadlisttableid td.by {
    width: auto !important;
}

body.pg_forumdisplay #threadlisttableid td.num {
    width: auto !important;
}

body.pg_forumdisplay #threadlisttableid td.by:first-of-type {
    grid-column: 3;
    grid-row: 1;
}

body.pg_forumdisplay #threadlisttableid td.num {
    grid-column: 4;
    grid-row: 1;
}

body.pg_forumdisplay #threadlisttableid td.by:last-child {
    display: none !important;
}

body.pg_forumdisplay #threadlisttableid td.by cite,
body.pg_forumdisplay #threadlisttableid td.by em,
body.pg_forumdisplay #threadlisttableid td.num a,
body.pg_forumdisplay #threadlisttableid td.num em {
    display: block;
    float: none !important;
    width: auto !important;
    margin: 2px 0 !important;
    color: inherit !important;
}

body.pg_forumdisplay #threadlisttableid td.num a {
    color: #947017 !important;
    font-size: 20px;
    font-weight: 800;
}

/* 公告列 */
body.pg_forumdisplay #threadlisttableid > tbody:first-of-type strong.xst {
    color: #9c7111;
}

/* 管理勾選框不要破壞卡片 */
body.pg_forumdisplay #threadlisttableid td.o {
    position: absolute;
    z-index: 4;
    right: 12px;
    top: 10px;
    width: auto !important;
    padding: 0 !important;
    background: transparent !important;
}

/* 分頁 */
body.pg_forumdisplay .pg a,
body.pg_forumdisplay .pg strong,
body.pg_forumdisplay .pg label {
    border-color: var(--fd-line) !important;
    background: #fffdf8 !important;
    color: #715719 !important;
}

body.pg_forumdisplay .pg strong {
    background: linear-gradient(180deg, #f5df83, #d7ad2d) !important;
    color: #32260c !important;
}

/* ===== 手機版 ===== */
@media screen and (max-width: 768px) {
    html,
    body.pg_forumdisplay {
        max-width: 100%;
        overflow-x: hidden !important;
    }

    body.pg_forumdisplay .wp,
    body.pg_forumdisplay #ct,
    body.pg_forumdisplay .mn,
    body.pg_forumdisplay .boardnav {
        width: auto !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        box-sizing: border-box;
    }

    body.pg_forumdisplay .bml {
        margin: 12px !important;
        border-radius: 16px !important;
    }

    body.pg_forumdisplay .bml .bm_h {
        padding: 20px 18px 10px !important;
    }

    body.pg_forumdisplay .bml .bm_h h1 {
        font-size: 23px !important;
    }

    body.pg_forumdisplay .bml .bm_h .y {
        float: none !important;
        display: flex;
        flex-wrap: wrap;
        margin: 12px 0 0;
    }

    body.pg_forumdisplay .bml .bm_c {
        padding: 0 18px 18px !important;
    }

    body.pg_forumdisplay #pgt {
        margin: 0 12px !important;
    }

    body.pg_forumdisplay #newspecial {
        min-width: 142px;
        height: 44px !important;
        padding: 0 17px;
    }

    body.pg_forumdisplay #thread_types,
    body.pg_forumdisplay #threadlist .th {
        margin: 12px !important;
        border-radius: 14px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.pg_forumdisplay #thread_types {
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    body.pg_forumdisplay #threadlist .tf {
        flex-wrap: nowrap;
        min-width: max-content;
    }

    body.pg_forumdisplay #threadlist > .bm_c {
        padding: 0 12px !important;
    }

    body.pg_forumdisplay #threadlisttableid > tbody {
        margin-bottom: 14px;
        border-radius: 16px;
    }

    body.pg_forumdisplay #threadlisttableid > tbody > tr {
        display: grid !important;
        grid-template-columns: 118px minmax(0, 1fr) !important;
        min-height: 178px;
    }

    body.pg_forumdisplay #threadlisttableid td.icn {
        grid-column: 1;
        grid-row: 1;
        min-height: 178px;
        padding: 12px !important;
        border-right: 1px solid #eee2bd !important;
    }

    body.pg_forumdisplay #threadlisttableid th {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-start;
        padding: 22px 18px !important;
    }

    body.pg_forumdisplay #threadlisttableid th > a.s.xst,
    body.pg_forumdisplay #threadlisttableid th > a.xst {
        font-size: 18px !important;
        line-height: 1.7 !important;
    }

    body.pg_forumdisplay #threadlisttableid th::after {
    content: none !important;
    display: none !important;
}

    body.pg_forumdisplay #threadlisttableid td.by,
    body.pg_forumdisplay #threadlisttableid td.num {
        display: none !important;
    }

    body.pg_forumdisplay #threadlisttableid td.o {
        right: 8px;
        top: 8px;
    }

    body.pg_forumdisplay .pgs {
        margin: 12px !important;
    }
}

@media screen and (max-width: 390px) {
    body.pg_forumdisplay #threadlisttableid > tbody > tr {
        grid-template-columns: 104px minmax(0, 1fr) !important;
    }

    body.pg_forumdisplay #threadlisttableid td.icn {
        min-height: 166px;
    }

    body.pg_forumdisplay #threadlisttableid th {
        padding: 18px 14px !important;
    }

    body.pg_forumdisplay #threadlisttableid th > a.s.xst,
    body.pg_forumdisplay #threadlisttableid th > a.xst {
        font-size: 17px !important;
    }
}


/* ===== Build 2: 帖子圖片優先，無圖才使用 /webp/ fallback ===== */
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card td.icn {
    position: relative !important;
    padding: 0 !important;
    overflow: hidden !important;
}
body.pg_forumdisplay .sl-thread-thumb {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
body.pg_forumdisplay .sl-thread-cover {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    border: 0 !important;
}
body.pg_forumdisplay .sl-thread-fallback {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
}
body.pg_forumdisplay .sl-thread-state {
    position: absolute !important;
    z-index: 3 !important;
    left: 10px !important;
    top: 10px !important;
    right: auto !important;
    bottom: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.9) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.13) !important;
}
body.pg_forumdisplay .sl-thread-state img {
    max-width: 19px !important;
    max-height: 19px !important;
}
/* 只有沒有 .sl-thread-cover 時，才會看到 td.icn 的 fallback 背景圖。 */
body.pg_forumdisplay td.icn:has(.sl-thread-cover) {
    background-image: none !important;
}
@supports not selector(:has(*)) {
    body.pg_forumdisplay .sl-thread-cover { background:#eee; }
}

/* ===== Build 3：內容卡片精修 ===== */

/* 僅保留一組「閱讀內容」 */
body.pg_forumdisplay .sl-read-cue {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: max-content;
    margin-top: 16px;
    color: #987116;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 800;
}
body.pg_forumdisplay .sl-read-cue b {
    font-size: 18px;
    font-weight: 500;
}

/* 避免 hook／附件圖示被放大成正文巨圖 */
body.pg_forumdisplay #threadlisttableid th img:not(.vm),
body.pg_forumdisplay #threadlisttableid th > img,
body.pg_forumdisplay #threadlisttableid th .xst ~ img {
    width: auto !important;
    height: auto !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
}
body.pg_forumdisplay #threadlisttableid th img[src*="stamp"],
body.pg_forumdisplay #threadlisttableid th img[src*="filetype"],
body.pg_forumdisplay #threadlisttableid th img[src*="mobile-attach"],
body.pg_forumdisplay #threadlisttableid th img[src*="digest_"],
body.pg_forumdisplay #threadlisttableid th img[src*="recommend_"],
body.pg_forumdisplay #threadlisttableid th img[src*="hot_"] {
    display: inline-block !important;
    max-width: 22px !important;
    max-height: 22px !important;
    vertical-align: middle !important;
}

/* 封面永遠固定裁切，不讓原圖尺寸撐高卡片 */
body.pg_forumdisplay .sl-thread-thumb,
body.pg_forumdisplay .sl-thread-cover,
body.pg_forumdisplay .sl-thread-fallback {
    min-width: 0 !important;
    min-height: 0 !important;
}
body.pg_forumdisplay .sl-thread-cover {
    aspect-ratio: auto !important;
    object-fit: cover !important;
    object-position: center 28% !important;
}

/* 作者淡化，日期成為主要資訊 */
body.pg_forumdisplay .sl-thread-meta {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    order: 5;
    margin: 12px 0 0 !important;
    color: #9b948b !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}
body.pg_forumdisplay .sl-thread-meta a {
    color: #aaa39a !important;
    font-weight: 400 !important;
}
body.pg_forumdisplay .sl-thread-meta .pipe {
    color: #c7c0b5 !important;
}

/* 卡片尺寸統一 */
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card > tr {
    grid-template-columns: 210px minmax(0, 1fr) 100px 84px !important;
    min-height: 168px !important;
}
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card td.icn {
    height: 168px !important;
    min-height: 168px !important;
}
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th {
    min-height: 168px !important;
    padding: 22px 26px !important;
}
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th > a.s.xst,
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th > a.xst {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    max-height: 3.2em !important;
}

/* 隱藏原生預覽／操作符號，減少論壇感 */
body.pg_forumdisplay .tdpre,
body.pg_forumdisplay .showcontent,
body.pg_forumdisplay .showhide {
    display: none !important;
}

/* 左上資料夾 icon 縮小、降低存在感 */
body.pg_forumdisplay .sl-thread-state {
    width: 28px !important;
    height: 28px !important;
    left: 10px !important;
    top: 10px !important;
    opacity: .82;
}
body.pg_forumdisplay .sl-thread-state img {
    max-width: 16px !important;
    max-height: 16px !important;
}

/* 上、下方發帖按鈕都統一成中文金色按鈕 */
body.pg_forumdisplay a[id^="newspecial"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 150px !important;
    height: 46px !important;
    padding: 0 22px !important;
    border: 1px solid #c99f28 !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #f7df75, #d6aa26) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 7px 16px rgba(143,101,12,.16) !important;
    color: #35280c !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 46px !important;
    text-indent: 0 !important;
    text-decoration: none !important;
}
body.pg_forumdisplay a[id^="newspecial"] img {
    display: none !important;
}
body.pg_forumdisplay a[id^="newspecial"]::before {
    content: "發表新內容";
}

/* 公告也使用正常卡片，不出現巨大正文圖 */
body.pg_forumdisplay #threadlisttableid > tbody:not(.sl-thread-card) th img {
    max-width: 24px !important;
    max-height: 24px !important;
}

/* 手機：固定左圖右文，所有圖片高度一致 */
@media screen and (max-width: 768px) {
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card > tr {
        grid-template-columns: 128px minmax(0, 1fr) !important;
        min-height: 190px !important;
    }
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card td.icn {
        width: 128px !important;
        height: 190px !important;
        min-height: 190px !important;
    }
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th {
        min-height: 190px !important;
        padding: 20px 17px !important;
    }
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th > a.s.xst,
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th > a.xst {
        font-size: 18px !important;
        line-height: 1.65 !important;
        -webkit-line-clamp: 3 !important;
        max-height: 4.95em !important;
    }
    body.pg_forumdisplay .sl-read-cue {
        margin-top: auto !important;
        padding-top: 14px;
        font-size: 14px;
    }
    body.pg_forumdisplay .sl-thread-meta {
        margin-top: 9px !important;
        font-size: 12px !important;
    }
    body.pg_forumdisplay .sl-thread-state {
        width: 28px !important;
        height: 28px !important;
        left: 9px !important;
        top: 9px !important;
    }
}

@media screen and (max-width: 390px) {
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card > tr {
        grid-template-columns: 112px minmax(0, 1fr) !important;
        min-height: 180px !important;
    }
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card td.icn {
        width: 112px !important;
        height: 180px !important;
        min-height: 180px !important;
    }
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th {
        min-height: 180px !important;
        padding: 17px 14px !important;
    }
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th > a.s.xst,
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card th > a.xst {
        font-size: 17px !important;
    }
}


/* ===== Build 4：真實文章圖優先、卡片間距與底部按鈕修正 ===== */
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card {
    margin: 0 0 14px !important;
}
body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card > tr {
    column-gap: 0 !important;
    row-gap: 0 !important;
}
body.pg_forumdisplay #threadlisttableid td.icn {
    overflow: hidden !important;
    padding: 0 !important;
}
body.pg_forumdisplay .sl-thread-thumb {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}
body.pg_forumdisplay .sl-thread-cover,
body.pg_forumdisplay .sl-thread-fallback {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}
body.pg_forumdisplay .sl-thread-cover {
    z-index: 2;
    display: block;
    object-fit: cover !important;
    object-position: center 28% !important;
}
body.pg_forumdisplay .sl-thread-fallback {
    z-index: 1;
    display: block;
    background-size: cover !important;
    background-position: center !important;
}
body.pg_forumdisplay .sl-thread-state {
    z-index: 5 !important;
}

/* 清除 Hook 殘留的正文圖與多餘圖示，只保留縮圖區中的封面 */
body.pg_forumdisplay #threadlisttableid th img:not(.vm) {
    display: none !important;
}
body.pg_forumdisplay #threadlisttableid th img.vm {
    max-width: 20px !important;
    max-height: 20px !important;
}

/* 底部紅色 Discuz 發帖圖強制改為金色文字按鈕 */
body.pg_forumdisplay #pgt + * a#newspecialtmp,
body.pg_forumdisplay a#newspecialtmp,
body.pg_forumdisplay .pgs a#newspecialtmp,
body.pg_forumdisplay .pgs a[id="newspecialtmp"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 150px !important;
    width: auto !important;
    height: 46px !important;
    padding: 0 22px !important;
    border: 1px solid #c99f28 !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg,#f7df75,#d6aa26) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75),0 7px 16px rgba(143,101,12,.16) !important;
    color: #35280c !important;
    font-size: 0 !important;
    line-height: 46px !important;
    text-indent: 0 !important;
    overflow: hidden !important;
}
body.pg_forumdisplay a#newspecialtmp img {
    display: none !important;
}
body.pg_forumdisplay a#newspecialtmp::before {
    content: "發表新內容" !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

@media screen and (max-width:768px) {
    body.pg_forumdisplay #threadlisttableid > tbody.sl-thread-card {
        margin-bottom: 12px !important;
    }
    body.pg_forumdisplay .sl-thread-cover,
    body.pg_forumdisplay .sl-thread-fallback {
        object-position: center 24% !important;
    }
}
