/* ===== FMCE RESPONSIVE 20261203 v2 : same desktop skin, mobile adaptive ===== */
@media screen and (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  #wp, .wp, .wp.mtn, .wp.cl, .wp.w {
    width: auto !important; max-width: 100% !important;
    margin-left: 0 !important; margin-right: 0 !important;
    padding-left: 10px !important; padding-right: 10px !important;
    box-sizing: border-box;
  }
  #ct.wp, #ct { width: auto !important; max-width: 100% !important; padding: 0 10px !important; box-sizing: border-box; }
  .mn { float: none !important; width: auto !important; margin: 0 !important; }
  #sd, .sd { float: none !important; width: auto !important; margin: 16px 0 0 !important; }
  .mn .bm, .sd .bm, .bm { width: auto !important; max-width: 100% !important; }
  img, video, iframe, embed { max-width: 100% !important; height: auto !important; }
  table, .tbl, .list table { display: block; width: 100% !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  pre, code, .codeblock, .blockcode { white-space: pre-wrap !important; word-break: break-all; }
  * { -webkit-tap-highlight-color: transparent; }
  a, p, li, td, .t_f, .s { line-height: 1.75; }
  .t_f, .t_f td { font-size: 16px !important; }
  h1, .ts { font-size: 20px !important; line-height: 1.45 !important; }
  .pl, .pls { padding-left: 8px !important; padding-right: 8px !important; }
  .pi, .pbody { padding-left: 10px !important; padding-right: 10px !important; }
  .pg, .pgbtn { margin: 14px 0 !important; }
  .pg a, .pg strong, .pg label { min-width: 32px; height: 32px; line-height: 32px; display: inline-block; text-align: center; }

  /* ---- header ---- */
  .fmce_v98 .fmce_inner { padding-left: 10px !important; padding-right: 10px !important; }
  .fmce_v98 .fmce_nav {
    display: flex !important; flex-wrap: wrap !important;
    align-items: center !important; height: auto !important;
    min-height: 0 !important; padding: 9px 0 10px !important; row-gap: 8px !important;
  }
  .fmce_v98 .brand { flex: 0 0 auto !important; margin-right: 6px !important; }
  .fmce_v98 .brand .bn { font-size: 16px !important; letter-spacing: 0 !important; }
  .fmce_v98 .brand .bd { font-size: 10.5px !important; }
  .fmce_v98 .fmce_nav a.nav { font-size: 13px !important; padding: 0 7px !important; margin: 0 !important; }
  .fmce_v98 .fmce_nav a.nav[href*="fid=423"],
  .fmce_v98 .fmce_nav a.nav[href*="fid=424"],
  .fmce_v98 .fmce_nav a.nav[href*="fid=425"] { display: none !important; }
  .fmce_v98 .user-entry { margin-left: auto !important; order: 5 !important; }
  .fmce_v98 .user-entry a { font-size: 13px !important; padding: 5px 12px !important; }
  .fmce_v98 .fmce_search {
    flex: 1 1 100% !important; order: 9 !important;
    width: 100% !important; min-width: 0 !important; margin: 2px 0 0 !important;
  }
  .fmce_v98 .fmce_search form { width: 100% !important; display: flex !important; }
  .fmce_v98 .fmce_search input {
    flex: 1 1 auto !important; width: auto !important; min-width: 0 !important;
    font-size: 14px !important; padding-left: 14px !important;
  }

  /* ---- thread page: kill left avatar column, full-width content ---- */
  #postlist .pls { display: none !important; }
  #postlist .pl { overflow: visible !important; float: none !important; width: auto !important; }
  #postlist .pct { margin-left: 0 !important; width: auto !important; float: none !important; }
  #postlist .plc { width: auto !important; }
  #postlist .plhin { width: auto !important; }
  .pls, .plc { float: none !important; }
  #postlist { width: auto !important; }
  .vwthd .y, .vwthd .z { float: none !important; display: inline-block !important; }
}
@media screen and (max-width: 480px) {
  .mn .bm_h h2, .bm_h h2 { font-size: 17px !important; }
  .fl_row .fl_i, .fl_row .fl_by { display: none !important; }
  .fmce_st { flex-wrap: wrap !important; }
  .fmce_v98 .brand .bn { font-size: 15px !important; }
  .fmce_v98 .brand .bd { font-size: 10px !important; }
  .fmce_v98 .fmce_nav a.nav { font-size: 12.5px !important; padding: 0 6px !important; }
}
/* ---- v3: pagination bar + thread toolbar ---- */
@media screen and (max-width: 900px) {
  #pgt, .pgs { width: auto !important; float: none !important; max-width: 100% !important; }
  #pgt { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 8px !important; min-height: 34px; }
  #pgt > span, #pgt > a, #pgt > div { float: none !important; display: inline-block !important; width: auto !important; }
  #pgt .pg { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 4px !important; width: auto !important; }
  #pgt .pg a, #pgt .pg strong, #pgt .pg label {
    float: none !important; display: inline-block !important;
    min-width: 28px !important; height: 28px !important; line-height: 28px !important;
    text-align: center !important; margin: 0 !important; padding: 0 6px !important;
  }
  #pgt .pgb, #pgt .pgb a { white-space: nowrap !important; width: auto !important; height: auto !important; line-height: 30px !important; }
  .pgs.mtm.mbm.cl { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }
  .pgs.mtm.mbm.cl > * { float: none !important; display: inline-block !important; width: auto !important; }
}
/* ---- v4: thread page #ct was a flex row, collapse to column ---- */
@media screen and (max-width: 900px) {
  #ct { display: block !important; }
  #ct > div, #ct > aside, #ct > form { width: 100% !important; max-width: 100% !important; float: none !important; margin-left: 0 !important; margin-right: 0 !important; box-sizing: border-box; }
  #ct > aside, .fmce-thread-side { margin-top: 18px !important; }
  #postlist { width: 100% !important; }
  #pgt, .pgs { width: 100% !important; }
}
/* ---- v5: force viewthread page to full width ---- */
@media screen and (max-width: 900px) {
  body.pg_viewthread #wp,
  body.pg_viewthread #ct,
  body.pg_viewthread #ct.wp {
    display: block !important;
    width: 100% !important; max-width: 100% !important;
    float: none !important; margin: 0 auto !important;
    padding-left: 10px !important; padding-right: 10px !important;
    box-sizing: border-box !important;
  }
  body.pg_viewthread #ct > div,
  body.pg_viewthread #ct > aside,
  body.pg_viewthread #ct > form {
    display: block !important;
    width: 100% !important; max-width: 100% !important;
    float: none !important; margin-left: 0 !important; margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  body.pg_viewthread #postlist,
  body.pg_viewthread #postlist .bm,
  body.pg_viewthread #postlist table { width: 100% !important; }
  body.pg_viewthread #pgt { width: 100% !important; }
}
/* ---- v6: thread page = flex column, hide right rail on phones ---- */
@media screen and (max-width: 900px) {
  body.pg_viewthread #ct,
  body.pg_viewthread #ct.wp {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    width: 100% !important; max-width: 100% !important;
    margin: 0 auto !important; padding: 0 10px !important;
    box-sizing: border-box !important;
  }
  body.pg_viewthread #ct > div,
  body.pg_viewthread #ct > form {
    width: auto !important; max-width: 100% !important;
    flex: 0 0 auto !important; float: none !important;
    margin-left: 0 !important; margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  body.pg_viewthread aside.fmce-thread-side,
  body.pg_viewthread #ct > aside {
    display: none !important;
  }
  body.pg_viewthread #postlist,
  body.pg_viewthread #postlist .bm { width: 100% !important; margin: 0 !important; }
  body.pg_viewthread #postlist table { width: 100% !important; }
  body.pg_viewthread #pgt { width: 100% !important; }
}
/* ---- v7: header fit + thread typography ---- */
@media screen and (max-width: 900px) {
  .fmce_v98 .fmce_inner { padding-left: 12px !important; padding-right: 12px !important; box-sizing: border-box !important; }
  .fmce_v98 .fmce_nav { padding-right: 0 !important; box-sizing: border-box !important; }
  .fmce_v98 .fmce_nav > a.nav:nth-of-type(n+6) { display: none !important; }
  .fmce_v98 .fmce_nav a.nav { font-size: 12.5px !important; padding: 0 5px !important; }
  .fmce_v98 .fmce_search { box-sizing: border-box !important; max-width: 100% !important; }
  .fmce_v98 .fmce_search form { box-sizing: border-box !important; max-width: 100% !important; }
  .fmce_v98 .fmce_search button { padding: 0 14px !important; }

  body.pg_viewthread .vwthd img,
  body.pg_viewthread #pgt img,
  body.pg_viewthread .pgs img { display: none !important; }
  body.pg_viewthread h1, body.pg_viewthread .ts { font-size: 18px !important; line-height: 1.55 !important; }
  body.pg_viewthread .t_f, body.pg_viewthread .t_f td { font-size: 15.5px !important; line-height: 1.9 !important; }
  body.pg_viewthread .pgs { font-size: 13px !important; }
}
/* ---- v8: header 3-row layout (logo / nav+login / search) ---- */
@media screen and (max-width: 900px) {
  .fmce_v98 .brand { order: 0 !important; flex: 0 0 auto !important; }
  .fmce_v98 .fmce_nav::before { content: "" !important; order: 1 !important; flex: 0 0 100% !important; height: 0 !important; margin: 0 !important; }
  .fmce_v98 .fmce_nav > a.nav { order: 2 !important; display: inline-block !important; }
  .fmce_v98 .fmce_nav > a.nav:nth-of-type(n+6) { display: none !important; }
  .fmce_v98 .fmce_nav .user-entry { order: 3 !important; margin-left: auto !important; }
  .fmce_v98 .fmce_nav .fmce_search { order: 4 !important; flex: 1 1 100% !important; margin-top: 8px !important; }
}
/* ---- v9: thread page final polish ---- */
@media screen and (max-width: 900px) {
  body.pg_viewthread #wp, body.pg_viewthread #ct { padding-left: 12px !important; padding-right: 12px !important; box-sizing: border-box !important; }
  body.pg_viewthread #pt, body.pg_viewthread #pt * { font-size: 13px !important; line-height: 1.7 !important; color: #666 !important; }
  body.pg_viewthread #pt a { color: #d42030 !important; }
  body.pg_viewthread #pt { padding: 10px 0 6px !important; margin: 0 !important; }
  body.pg_viewthread #postlist .ts { display: none !important; }
  body.pg_viewthread #postlist .plc, body.pg_viewthread #postlist .plc td, body.pg_viewthread #postlist .plhin { padding: 0 !important; }
  body.pg_viewthread #postlist .t_f, body.pg_viewthread #postlist .t_f td,
  body.pg_viewthread #postlist .t_f p, body.pg_viewthread #postlist .t_f div { font-size: 15px !important; line-height: 1.85 !important; }
  body.pg_viewthread h1 { font-size: 17px !important; line-height: 1.5 !important; margin: 8px 0 !important; }
}
/* ---- v10: forum display list -> mobile cards ---- */
@media screen and (max-width: 900px) {
  body.pg_forumdisplay #pt, body.pg_forumdisplay #pt * { font-size: 13px !important; line-height: 1.7 !important; color: #666 !important; }
  body.pg_forumdisplay #pt a { color: #d42030 !important; }
  body.pg_forumdisplay #pt { padding: 10px 0 6px !important; margin: 0 !important; }
  body.pg_forumdisplay #wp, body.pg_forumdisplay #ct { padding-left: 12px !important; padding-right: 12px !important; box-sizing: border-box !important; }

  body.pg_forumdisplay .bm h1, body.pg_forumdisplay #threadlist h1 { font-size: 17px !important; line-height: 1.4 !important; font-weight: 700 !important; }
  body.pg_forumdisplay .bm h2 { font-size: 15px !important; font-weight: 600 !important; }
  body.pg_forumdisplay .bm_c { font-size: 14px !important; line-height: 1.8 !important; }
  body.pg_forumdisplay .bm_c a { color: #d42030 !important; text-decoration: none !important; }

  body.pg_forumdisplay #threadlisttableid, body.pg_forumdisplay #threadlisttableid tbody,
  body.pg_forumdisplay #threadlisttableid tr, body.pg_forumdisplay #threadlisttableid td { display: block !important; width: auto !important; }
  body.pg_forumdisplay #threadlisttableid { border: 0 !important; }
  body.pg_forumdisplay #threadlisttableid tbody tr { padding: 12px 0 !important; border-bottom: 1px solid #f2e6e6 !important; position: relative !important; }
  body.pg_forumdisplay #threadlisttableid td.icn,
  body.pg_forumdisplay #threadlisttableid td.new,
  body.pg_forumdisplay #threadlisttableid td.fid,
  body.pg_forumdisplay #threadlisttableid td.num { display: none !important; }
  body.pg_forumdisplay #threadlisttableid td.th { padding: 0 !important; white-space: normal !important; word-break: break-all !important; }
  body.pg_forumdisplay #threadlisttableid td.th a.xst,
  body.pg_forumdisplay #threadlisttableid td.th a.s { font-size: 15px !important; line-height: 1.55 !important; font-weight: 600 !important; color: #222 !important; text-decoration: none !important; }
  body.pg_forumdisplay #threadlisttableid td.by { padding: 4px 0 0 !important; font-size: 12px !important; color: #999 !important; }
  body.pg_forumdisplay #threadlisttableid td.by:last-of-type { display: none !important; }
  body.pg_forumdisplay #threadlisttableid td.by a, body.pg_forumdisplay #threadlisttableid td.by em, body.pg_forumdisplay #threadlisttableid td.by span { font-size: 12px !important; color: #999 !important; text-decoration: none !important; }
  body.pg_forumdisplay #threadlisttableid .icn a, body.pg_forumdisplay #threadlisttableid .new a { font-size: 11px !important; }

  body.pg_viewthread .fmce_v98 .brand, body.pg_viewthread .fmce_v98 a.nav, body.pg_viewthread .fmce_v98 .user-entry a { text-decoration: none !important; }
  body.pg_viewthread #pgt a, body.pg_viewthread #postlist .pi a, body.pg_viewthread .plc .y a { color: #d42030 !important; text-decoration: none !important; }
}
/* ---- v11: kill nested attach table + link color ---- */
@media screen and (max-width: 900px) {
  body.pg_forumdisplay #threadlisttableid td.th table,
  body.pg_forumdisplay #threadlisttableid td.th tbody,
  body.pg_forumdisplay #threadlisttableid td.th tr,
  body.pg_forumdisplay #threadlisttableid td.th td { display: none !important; }
  body.pg_forumdisplay #threadlisttableid td.th img { display: none !important; }
  body.pg_forumdisplay #threadlisttableid td.th .quote { display: none !important; }
  body.pg_forumdisplay .bm a, body.pg_forumdisplay .bm_h a { color: #d42030 !important; text-decoration: none !important; }
  body.pg_forumdisplay .bm h1 a { color: #111 !important; }
  body.pg_forumdisplay .bm h1 span, body.pg_forumdisplay .bm h1 em { font-size: 13px !important; color: #888 !important; font-weight: 400 !important; }
  body.pg_forumdisplay .bm_c table, body.pg_forumdisplay #threadlist table { max-width: 100% !important; }
}
/* ---- v12: hide any nested table inside list cells ---- */
@media screen and (max-width: 900px) {
  body.pg_forumdisplay #threadlisttableid td table,
  body.pg_forumdisplay #threadlisttableid td .attachlist,
  body.pg_forumdisplay #threadlisttableid td dl { display: none !important; }
  body.pg_forumdisplay #threadlist { overflow-x: hidden !important; }
  body.pg_forumdisplay #threadlisttableid { width: 100% !important; max-width: 100% !important; overflow: hidden !important; }
}
/* ---- v13: list cell overflow scroll ---- */
@media screen and (max-width: 900px) {
  body.pg_forumdisplay #threadlisttableid { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch !important; }
  body.pg_forumdisplay #threadlisttableid td, body.pg_forumdisplay #threadlisttableid td * { max-width: 100% !important; box-sizing: border-box !important; }
  body.pg_forumdisplay #threadlisttableid td div[style] { width: auto !important; }
}
/* ---- v14: hide thread excerpt block in list ---- */
@media screen and (max-width: 900px) {
  body.pg_forumdisplay #threadlisttableid td.th .th_c,
  body.pg_forumdisplay #threadlisttableid td.th .summary,
  body.pg_forumdisplay #threadlisttableid td.th .attachlist { display: none !important; }
  body.pg_forumdisplay #threadlisttableid td.th > div { max-width: 100% !important; overflow: hidden !important; }
}
/* ---- v15: compact card thumb (real cause: cover image) ---- */
@media screen and (max-width: 900px) {
  .fmce-grid .fg-thumb { max-height: 150px !important; overflow: hidden !important; }
  .fmce-grid .fg-thumb img { width: 100% !important; height: 150px !important; object-fit: cover !important; }
  .fmce-grid .fg-card { margin-bottom: 12px !important; }
}
/* ---- v16: mobile list = text-only cards ---- */
@media screen and (max-width: 900px) {
  .fmce-grid .fg-thumb { display: none !important; }
  .fmce-grid .fg-card { display: block !important; padding: 12px 14px !important; margin-bottom: 10px !important; border-radius: 10px !important; }
}
/* ---- v17: hide broken collapse icon ---- */
@media screen and (max-width: 900px) {
  body.pg_forumdisplay .bm_h img, body.pg_forumdisplay .bm_h .o { display: none !important; }
}
/* ===== v18: mobile header tighten + search bar fix ===== */
@media screen and (max-width: 900px) {
  .fmce_v98 .fmce_nav { padding: 7px 14px 8px !important; row-gap: 6px !important; margin: 6px -14px 8px !important; }
  .fmce_v98 .user-entry a { padding: 4px 10px !important; }
  .fmce_v98 .fmce_search {
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    margin: 0 !important; box-sizing: border-box !important;
  }
  .fmce_v98 .fmce_search form {
    display: flex !important; width: 100% !important; max-width: 100% !important;
    box-sizing: border-box !important; gap: 6px !important; margin: 0 !important; padding: 0 !important;
  }
  .fmce_v98 .fmce_search input {
    flex: 1 1 0 !important; width: 1px !important; min-width: 0 !important;
    height: 38px !important; line-height: 38px !important;
    padding: 0 14px !important; font-size: 13.5px !important;
    box-sizing: border-box !important; border-radius: 19px !important;
  }
  .fmce_v98 .fmce_search button,
  .fmce_v98 .fmce_search .pn {
    flex: 0 0 auto !important; height: 38px !important; line-height: 38px !important;
    padding: 0 15px !important; font-size: 13.5px !important;
    margin: 0 !important; border-radius: 19px !important; box-sizing: border-box !important;
  }
}
/* ===== v19: override header.css deep selectors on mobile ===== */
@media screen and (max-width: 900px) {
  html body .fmce_v98 .fmce_inner { padding-left: 0 !important; padding-right: 0 !important; }
  html body .fmce_v98 .fmce_inner .fmce_nav {
    margin: 0 !important; padding: 8px 14px 8px 14px !important;
    border-radius: 0 !important; row-gap: 6px !important;
  }
  html body .fmce_v98 .fmce_inner .fmce_nav .fmce_search {
    flex: 1 1 100% !important; width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; margin: 8px 0 0 0 !important;
    height: 36px !important; border-radius: 18px !important;
    box-sizing: border-box !important; overflow: hidden !important;
    display: flex !important; align-items: center !important; position: static !important;
  }
  html body .fmce_v98 .fmce_inner .fmce_nav .fmce_search form {
    display: flex !important; width: 100% !important; height: 36px !important;
    margin: 0 !important; padding: 0 !important; gap: 0 !important; box-sizing: border-box !important;
  }
  html body .fmce_v98 .fmce_inner .fmce_nav .fmce_search input[type=text],
  html body .fmce_v98 .fmce_inner .fmce_nav .fmce_search input {
    flex: 1 1 auto !important; width: auto !important; min-width: 0 !important;
    height: 34px !important; line-height: 34px !important;
    font-size: 13px !important; padding: 0 0 0 14px !important;
    box-sizing: border-box !important; border: none !important; border-radius: 0 !important;
    background: transparent !important;
  }
  html body .fmce_v98 .fmce_inner .fmce_nav .fmce_search button {
    flex: 0 0 64px !important; width: 64px !important;
    height: 36px !important; line-height: 36px !important;
    font-size: 13px !important; margin: 0 !important; padding: 0 !important;
    border: none !important; border-radius: 0 !important; right: auto !important; top: auto !important;
  }
}
/* ===== v20: hide legacy discuz scrolltop bar under new footer ===== */
#scrolltop, #scrolltop span, #scrolltop a { display: none !important; }

/* ===== v21: mobile footer compact 2-col links ===== */
@media (max-width:900px){
  .fmce-ft{margin-top:18px !important;padding:20px 0 0 !important;}
  .fmce-ft-in{grid-template-columns:1fr !important;gap:18px !important;padding:0 16px !important;}
  .fmce-ft-brand{font-size:16px !important;}
  .fmce-ft-about p{font-size:12.5px !important;line-height:1.75 !important;margin-top:8px !important;}
  .fmce-ft h3{margin:0 0 8px !important;font-size:12.5px !important;}
  .fmce-ft ul{display:grid !important;grid-template-columns:1fr 1fr !important;column-gap:12px !important;row-gap:2px !important;}
  .fmce-ft li{margin:0 !important;line-height:1.5 !important;}
  .fmce-ft li a{display:inline-block !important;padding:5px 0 !important;font-size:12.5px !important;line-height:1.5 !important;}
  .fmce-ft-btm{margin-top:16px !important;padding:12px 16px 26px !important;}
}
