/* ==========================================================================
   modern58 — responsive modernization layer for 58.ca (Discuz! X5.0)
   Loaded after rentianji.css; overrides the fixed 1200px desktop layout
   with a fluid, mobile-first design system.
   ========================================================================== */

:root {
	--m58-maxw: min(100% - 16px, 1830px);  /* page width: near-full browser width */
	--m58-primary: #e4393c;          /* 58.ca brand red */
	--m58-primary-dark: #c62f32;
	--m58-primary-soft: #fdecec;
	--m58-accent: #ff7a45;
	--m58-text: #1f2329;
	--m58-text-2: #5f6672;
	--m58-text-3: #9aa1ac;
	--m58-bg: #f5f6f8;
	--m58-surface: #ffffff;
	--m58-border: #e7e9ee;
	--m58-radius: 12px;
	--m58-radius-sm: 8px;
	--m58-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	--m58-shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
	--m58-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
		"Helvetica Neue", Arial, sans-serif;
}

/* ---------- base ---------- */

html { -webkit-text-size-adjust: 100%; }

body {
	font-family: var(--m58-font) !important;
	font-size: 14px;
	line-height: 1.6;
	color: var(--m58-text);
	background: var(--m58-bg) !important;
}

a { transition: color .15s ease; }
a:hover { color: var(--m58-primary); text-decoration: none; }

img { max-width: 100%; height: auto; }

::selection { background: var(--m58-primary); color: #fff; }

/* ---------- fluid containers: kill the fixed 1200px grid ---------- */

.w-1200,
.wp,
#ft,
.ren-footer-box,
.ren-header-centre {
	width: auto !important;
	max-width: var(--m58-maxw) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 16px;
	padding-right: 16px;
	box-sizing: border-box;
}

.min-1200 { min-width: 0 !important; }
.mw-100 { min-width: 0 !important; }

/* nested containers shouldn't double-pad */
.w-1200 .w-1200 { padding-left: 0; padding-right: 0; }

/* ---------- header / navigation ---------- */

.ren-header-nav,
#fixed-header-wrap {
	background: var(--m58-surface) !important;
	box-shadow: var(--m58-shadow);
}

#hd.ren-header-nav { border-bottom: 1px solid var(--m58-border); }

.navbar {
	position: sticky;
	top: 0;
	z-index: 200;
	background: var(--m58-surface);
	border-bottom: 1px solid var(--m58-border);
}

.navbar-nav {
	display: flex !important;
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	margin: 0 auto;
	max-width: var(--m58-maxw);
	padding: 0 8px;
}
.navbar-nav::-webkit-scrollbar { display: none; }

.navbar-nav li { float: none !important; flex: 0 0 auto; }

.navbar-nav li a {
	display: block;
	padding: 12px 18px !important;
	font-size: 15px;
	font-weight: 500;
	color: var(--m58-text) !important;
	background: none !important;
	border-radius: 0;
	position: relative;
}

.navbar-nav li a:hover { color: var(--m58-primary) !important; }

.navbar-nav li.a a {
	color: var(--m58-primary) !important;
	font-weight: 600;
}
.navbar-nav li.a a::after {
	content: "";
	position: absolute;
	left: 18px; right: 18px; bottom: 0;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--m58-primary);
}

/* search box */
.rtj1009-sousuo input[type="text"],
.rtj1009-sousuo .px,
#scbar_txt {
	border: 1.5px solid var(--m58-border) !important;
	border-radius: 999px !important;
	background: var(--m58-bg) !important;
	padding: 8px 16px !important;
	height: auto !important;
	transition: border-color .15s ease, background .15s ease;
}
.rtj1009-sousuo input[type="text"]:focus,
#scbar_txt:focus {
	border-color: var(--m58-primary) !important;
	background: #fff !important;
	outline: none;
}

/* post button */
.ren-nav-postbtn a,
.btn-primary {
	background: var(--m58-primary) !important;
	border: none !important;
	border-radius: 999px !important;
	box-shadow: 0 2px 6px rgba(228, 57, 60, .3);
	transition: background .15s ease, transform .1s ease;
}
.ren-nav-postbtn a:hover,
.btn-primary:hover {
	background: var(--m58-primary-dark) !important;
	transform: translateY(-1px);
}

/* ---------- cards & content blocks ---------- */

.ren-common-row,
.ren-card,
.bg-white,
.area .bg-white {
	border-radius: var(--m58-radius);
}

.ren-common-row {
	background: var(--m58-surface) !important;
	box-shadow: var(--m58-shadow);
	border: 1px solid var(--m58-border);
	overflow: hidden;
}

.ren-card {
	border-bottom: 1px solid var(--m58-border) !important;
	padding-bottom: 10px;
}
.ren-card .font-24, .ren-card h2, .ren-card h3 {
	font-weight: 600;
	color: var(--m58-text);
}

/* list rows hover */
.ren-common-left li:hover,
.ren-common-right li:hover { background: var(--m58-bg); border-radius: var(--m58-radius-sm); }

/* forum tables (bm/fl classic Discuz blocks) */
.bm, .fl {
	border: 1px solid var(--m58-border) !important;
	border-radius: var(--m58-radius);
	overflow: hidden;
	box-shadow: var(--m58-shadow);
	background: var(--m58-surface);
}
.bm_h, .bm_c { border-color: var(--m58-border) !important; }
th, td { border-color: var(--m58-border) !important; }

/* thread list readability */
.tl th, .tl td { padding-top: 10px; padding-bottom: 10px; }
.tl .s.xst { font-size: 15px; }

/* pagination */
.pg a, .pg strong, .pgb a, .pg label {
	border: 1px solid var(--m58-border) !important;
	border-radius: var(--m58-radius-sm) !important;
	background: var(--m58-surface) !important;
	margin: 0 3px;
	transition: all .15s ease;
}
.pg a:hover { border-color: var(--m58-primary) !important; color: var(--m58-primary) !important; }
.pg strong {
	background: var(--m58-primary) !important;
	border-color: var(--m58-primary) !important;
	color: #fff !important;
}

/* buttons (Discuz classic) */
.pn {
	border-radius: var(--m58-radius-sm) !important;
	border: 1px solid var(--m58-border) !important;
	transition: all .15s ease;
}
.pn.pnc {
	background: var(--m58-primary) !important;
	border-color: var(--m58-primary) !important;
}
.pn.pnc:hover { background: var(--m58-primary-dark) !important; }

/* forms */
input.px, textarea.pt, select.ps {
	border: 1.5px solid var(--m58-border) !important;
	border-radius: var(--m58-radius-sm) !important;
	transition: border-color .15s ease;
}
input.px:focus, textarea.pt:focus { border-color: var(--m58-primary) !important; }

/* avatars */
.avatar img, .avt img { border-radius: 50%; }

/* ---------- footer ---------- */

.ren-footer {
	background: #23272f !important;
	margin-top: 32px;
	padding: 32px 0 16px;
}
.ren-footer-in {
	display: flex !important;
	flex-wrap: wrap;
	gap: 24px 48px;
	float: none !important;
}
.ren-footer-in dl { float: none !important; margin: 0; min-width: 140px; }
.ren-footer-in dt { color: #fff; font-weight: 600; margin-bottom: 10px; }
.ren-footer-in dd a { color: #9aa1ac; }
.ren-footer-in dd a:hover { color: #fff; }
.ren-footer-bottom {
	background: #1b1e24 !important;
	color: #9aa1ac;
}
.ren-footer-bottom a { color: #9aa1ac; }
.ren-footer-bottom a:hover { color: #fff; }

/* ---------- floating tools ---------- */

#scrolltop span a, #scrolltop .returnlist, #scrolltop .returnboard {
	border-radius: var(--m58-radius-sm);
	box-shadow: var(--m58-shadow);
}

/* ---------- mobile nav toggle (injected by modern.js) ---------- */

.m58-menu-btn {
	display: none;
	background: none;
	border: none;
	padding: 10px 14px;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	color: var(--m58-text);
}

/* ==========================================================================
   Responsive retrofit
   ========================================================================== */

@media (max-width: 1240px) {
	.w-1200, .wp { max-width: 100% !important; }
}

@media (max-width: 992px) {
	/* two-column portal layout stacks */
	.ren-common-left, .ren-common-right {
		float: none !important;
		width: 100% !important;
		margin: 0 0 16px !important;
	}
	/* forum page side column */
	#ct .sd, .fl .fl_g { width: auto; }
	/* hide heavyweight desktop-only ad rails */
	.a_fl, .a_fr, .a_cb { display: none !important; }
}

@media (max-width: 768px) {
	body { font-size: 15px; }

	/* header condenses */
	.ren-header-centre h3 { max-width: 140px; overflow: hidden; }
	.rtj1009-sousuo { width: 100% !important; margin-top: 8px; }
	.ren-nav-postbtn { display: none !important; }
	.ren-header-userstatus { float: right !important; }

	/* generic float un-stick for stacked layouts inside content areas */
	#ct .z, #ct .y,
	.ren-common-diy .z, .ren-common-diy .y {
		float: none !important;
	}
	.ren-common-diy img { width: 100%; }

	/* index channel blocks become single column cards */
	.ren-index-row-san > div, .ren-index-row-wu > div {
		width: 100% !important;
		float: none !important;
		margin: 0 0 12px !important;
	}

	/* thread lists: hide secondary columns */
	.tl .by, .tl .num, th.by, th.num { display: none !important; }
	.tl th, .tl td { display: block; width: auto !important; }
	.tl tr { display: block; border-bottom: 1px solid var(--m58-border); padding: 8px 0; }

	/* post page */
	#postlist .pls { width: 100% !important; float: none !important; display: block; }
	#postlist .plc { display: block; margin-left: 0 !important; }
	.pls .avatar { float: left; margin-right: 10px; }

	/* footer stacks */
	.ren-footer-in { flex-direction: column; gap: 16px; }
	.ren-footer-y { float: none !important; }

	/* hide desktop floaters on touch */
	#scrolltop .ren-scrol-qq, #scrolltop .ren-scrol-weixin { display: none; }
}

@media (max-width: 480px) {
	.w-1200, .wp { padding-left: 12px; padding-right: 12px; }
	.navbar-nav li a { padding: 10px 12px !important; font-size: 14px; }
}

/* ---------- mobile nav drawer ---------- */

@media (max-width: 768px) {
	.m58-menu-btn { display: block; }
	.navbar { display: flex; align-items: center; }
	.navbar .navbar-collapse { flex: 1; min-width: 0; }
	.navbar.m58-open .navbar-nav {
		display: block !important;
		position: absolute;
		left: 0; right: 0; top: 100%;
		background: var(--m58-surface);
		border-bottom: 1px solid var(--m58-border);
		box-shadow: var(--m58-shadow-lg);
		max-height: 70vh;
		overflow-y: auto;
		padding: 6px 0;
		z-index: 300;
	}
	.navbar.m58-open .navbar-nav li a {
		padding: 12px 20px !important;
		border-bottom: 1px solid var(--m58-border);
	}
	.navbar.m58-open .navbar-nav li.a a::after { display: none; }
	.navbar.m58-open .navbar-nav li.a a { background: var(--m58-primary-soft) !important; }
}

/* ==========================================================================
   Homepage (portal/index) responsive retrofit
   Fixed-width blocks defined in extend_common.css become fluid.
   ========================================================================== */

/* desktop polish */
.ren-index-rowe .ren-slider,
.ren-index-right-yi,
.ren-index-right-e,
.ren-index-left-menu { border-radius: var(--m58-radius); overflow: hidden; }

@media (max-width: 1240px) {
	/* hero: menu (300) + slider (560) + right rail (320) can't fit — drop menu */
	.ren-index-left-menu { display: none; }
	.ren-left-none .ren-index-rowe,
	.ren-index-rowe { width: calc(100% - 340px) !important; }
	.ren-index-rowe .ren-slider { width: 100% !important; }
}

@media (max-width: 992px) {
	/* hero stacks: slider full width, right rail below */
	.ren-index-rowe,
	.ren-left-none .ren-index-rowe { width: 100% !important; float: none !important; }
	.ren-index-rowe .ren-slider,
	.ren-index-rowe .flexslider,
	.ren-index-rowe .slides li { height: auto !important; min-height: 200px; }
	.ren-index-rowe .slides img { width: 100%; height: auto; }
	.ren-index-rowsan,
	.ren-index-rowsan .ren-index-right-info,
	.ren-index-rowsan .ren-index-right-yi,
	.ren-index-rowsan .ren-index-right-fix { width: 100% !important; float: none !important; }
	.ren-index-rowsan { margin-top: 16px; }
	.ren-index-rowsan .ren-slider { width: 100% !important; height: auto !important; }

	/* channel rows: slider + link columns reflow */
	.rc-e8-ndiy, .rc-e8-ndiy .ren-slider { width: 100% !important; height: auto !important; }
	.ren-common-left-e { width: 100% !important; float: none !important; margin-top: 12px; }
}

@media (max-width: 768px) {
	/* headline link lists become full-width rows */
	.rc-e3-ndiy li, .rc-e3-ndiy li a { width: 100% !important; box-sizing: border-box; }

	/* image grids become fluid 2-up / 3-up */
	.rc-e10-ndiy ul, .rc-e12-ndiy ul {
		display: grid !important;
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 10px;
	}
	.rc-e10-ndiy li, .rc-e12-ndiy li {
		width: auto !important; height: auto !important;
		float: none !important; margin: 0 !important;
		border-radius: var(--m58-radius-sm); overflow: hidden;
	}
	.rc-e10-ndiy li img, .rc-e12-ndiy li img {
		width: 100% !important; height: auto !important;
		aspect-ratio: 4 / 3; object-fit: cover;
	}

	/* section headers scale down */
	.ren-card .font-24 { font-size: 18px !important; }

	/* top notice strips / secondary hero rows */
	.rtj1009-iho-0, .rtj1009-iho-1, .rtj1009-iho-2, .rtj1009-iho-3 { overflow-x: auto; }
	.rtj1009-iho-0 img, .rtj1009-iho-1 img, .rtj1009-iho-2 img, .rtj1009-iho-3 img { max-width: 100%; height: auto; }
}

/* ==========================================================================
   Forum pages (forumdisplay / viewthread) responsive retrofit
   ========================================================================== */

/* desktop polish: post cards */
#postlist > div { border-radius: var(--m58-radius); overflow: hidden; margin-bottom: 12px; }
.plh .ts, #thread_subject { font-size: 20px; line-height: 1.4; font-weight: 600; }
.t_f { font-size: 15px; line-height: 1.8; }
.t_f img { border-radius: var(--m58-radius-sm); }

@media (max-width: 992px) {
	/* main + sidebar stack */
	#ct .mn { width: 100% !important; float: none !important; }
	#ct .sd, .ren-sd-diy-san { width: 100% !important; float: none !important; margin: 16px 0 0 !important; }
	.ren-sd-diy-san .rc-e2-ndiy img, .ren-sd-diy-san .rc-e2-ndiy span,
	.ren-sd-diy-san .rc-e3-ndiy li, .ren-sd-diy-san .rc-e3-ndiy li a { width: 100% !important; height: auto !important; }
}

@media (max-width: 768px) {
	/* author column collapses into a horizontal byline */
	#postlist .pls {
		width: 100% !important; float: none !important;
		display: flex; align-items: center; gap: 10px;
		padding: 10px 12px !important;
		border-bottom: 1px solid var(--m58-border);
		background: var(--m58-surface) !important;
	}
	#postlist .pls .avatar { margin: 0; }
	#postlist .pls .avatar img { width: 40px !important; height: 40px !important; }
	#postlist .pls .tns, #postlist .pls .xg1,
	#postlist .pls .pil, #postlist .pls .p_pofl { display: none; }
	#postlist .plc { margin-left: 0 !important; display: block; }

	/* thread content: never overflow */
	.t_f, .pcb { word-break: break-word; overflow-wrap: anywhere; }
	.t_f table { display: block; overflow-x: auto; }

	/* reply editor */
	#fastpostform .pls { display: none !important; }
	#fastpostform .plc { margin: 0 !important; }

	/* breadcrumbs wrap */
	#pt .z { float: none; }
	#pt { white-space: normal; line-height: 1.8; }

	/* forumdisplay filter bar scrolls horizontally */
	#filter_special_menu, .tf, .th_f { overflow-x: auto; }
}

/* ==========================================================================
   Auth pages (login / register) + search + accessibility
   ========================================================================== */

.m58-auth-wrap { padding: 60px 16px !important; }

.m58-auth-card {
	width: 100% !important;
	max-width: 430px;
	background: var(--m58-surface);
	border: 1px solid var(--m58-border);
	border-radius: var(--m58-radius);
	box-shadow: var(--m58-shadow-lg);
	padding: 28px 28px 20px;
	box-sizing: border-box;
}
.m58-auth-card-wide { max-width: 720px; }

.ren-login .rfm td input, .ren-login .rfm td select {
	border-radius: var(--m58-radius-sm) !important;
}

@media (max-width: 768px) {
	.m58-auth-wrap { padding: 24px 12px !important; }
	.m58-auth-card { padding: 20px 16px 14px; }
	.ren-login .rfm { min-width: 0 !important; }
	.ren-login .rfm th { min-width: 56px; }
}

/* search results */
.slst ul li, .xs3 { line-height: 1.5; }
.slst { word-break: break-word; }
@media (max-width: 768px) {
	.slst ul li { padding: 10px 4px; }
	#scform_tb, .sttl { overflow-x: auto; }
}

/* ---------- accessibility ---------- */

a:focus-visible, button:focus-visible, input:focus-visible,
.m58-menu-btn:focus-visible {
	outline: 2px solid var(--m58-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================================
   News article pages (portal view) — readability
   ========================================================================== */

.ren-article-view h1#thread_subject,
.ren-article-view h1 {
	font-size: 26px;
	line-height: 1.35;
	font-weight: 700;
	text-wrap: balance;
}

#article_content {
	font-size: 17px !important;
	line-height: 1.85;
	color: var(--m58-text);
	word-break: break-word;
	overflow-wrap: anywhere;
}
#article_content p { margin: 0 0 1em; }
#article_content img {
	max-width: 100% !important;
	height: auto !important;
	border-radius: var(--m58-radius-sm);
	display: block;
	margin: 12px auto;
}
#article_content table { display: block; max-width: 100%; overflow-x: auto; }
#article_content iframe, #article_content video { max-width: 100%; }

/* byline / meta strip */
.ren-article-view .xg1 { color: var(--m58-text-3); font-size: 13px; }

/* comfortable reading measure on wide screens */
@media (min-width: 992px) {
	.ren-article-view .vwtb { max-width: 860px; margin: 0 auto; }
}

@media (max-width: 768px) {
	.ren-article-view h1 { font-size: 21px; }
	#article_content { font-size: 16px !important; }
	.ren-article-category { overflow-x: auto; }
}

/* ==========================================================================
   Inline fixed-width clamp (audit pass)
   Many legacy templates carry style="width: NNNpx". Cap them at the
   container width instead of editing every template.
   ========================================================================== */

div[style*="width"], span[style*="width"], p[style*="width"],
textarea[style*="width"], input[style*="width"], form[style*="width"],
a[style*="width"], img[style*="width"], table[style*="width"] {
	max-width: 100% !important;
	box-sizing: border-box;
}

/* paired homepage ad banners (inline width: 590px) stay side-by-side fluidly */
.wp a.z[style*="width: 590px"], .wp a.y[style*="width: 590px"] {
	width: 49.2% !important;
}
@media (max-width: 768px) {
	.wp a.z[style*="width: 590px"], .wp a.y[style*="width: 590px"] {
		width: 100% !important;
		float: none !important;
		display: block;
		margin-bottom: 8px;
	}
}

/* user-space control panels: fluid editors and DIY dialogs */
.diywin { width: auto !important; }
textarea.pt, input.px { max-width: 100%; }
@media (max-width: 768px) {
	.exfm, .diywin { width: 100% !important; }
	.appl { width: 100% !important; float: none !important; }  /* home sidebar */
	.tbmu, .ptm { overflow-x: auto; }
}

/* group page right column */
@media (max-width: 992px) {
	.group-wrap .y[style*="width"] { width: 100% !important; float: none !important; }
}

/* ==========================================================================
   Kill the legacy 1500px master grid (extend_common.css)
   ========================================================================== */

#nv_misc.pg_mobile #wp,
#darkroomtable,
#fixed-header,
#nv.navbar .navbar-collapse,
.ren-nav-bg .ren-header-nav #nv.navbar,
.ren-navsub-menu1, .ren-navsub-menu2, .ren-navsub-menu3,
.nav-wu .bg-se .ren-navsub-menu3, .nav-si .bg-se .ren-navsub-menu2,
#pt {
	width: auto !important;
	max-width: var(--m58-maxw) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

#nv.navbar,
.pg_logging, .pg_logging .wp, .pg_register .wp {
	min-width: 0 !important;
}

#pt { height: auto !important; min-height: 46px; }

/* ==========================================================================
   User space (home/) polish
   ========================================================================== */

/* profile header + tab bars */
#uhd {
	border-radius: var(--m58-radius);
	border: 1px solid var(--m58-border);
	background: var(--m58-surface);
	box-shadow: var(--m58-shadow);
	overflow: hidden;
}
#uhd .tb, .tb.cl {
	border-bottom: 1px solid var(--m58-border);
}
.tb .a a {
	color: var(--m58-primary) !important;
	border-bottom: 2px solid var(--m58-primary);
	background: none !important;
	font-weight: 600;
}

/* friend / member cards */
.buddy, .ml li {
	border-radius: var(--m58-radius-sm);
	transition: background .15s ease;
}
.buddy:hover, .ml li:hover { background: var(--m58-bg); }

@media (max-width: 768px) {
	/* space two-column layout stacks */
	#ct .appl + .tbn, .tbn { width: 100% !important; float: none !important; }
	#uhd .mt { display: block; }
	.ml li { width: 46% !important; }
	.tb li { float: left; }
	.tb { overflow-x: auto; white-space: nowrap; }
}

/* ==========================================================================
   Portal list pages (news categories) + group/tag + post editor
   ========================================================================== */

/* list layout: main column + right rail become fluid */
.ren-main-mn.ren-main-left,
.ren-list-right-g .ren-main-left,
.ren-forumdisplay .ren-list-right-k .ren-main-left,
.ren-article-wrap .ren-main-left {
	width: calc(100% - 340px) !important;
}
.ren-article-wrap .ren-main-left { width: calc(100% - 340px) !important; }
@media (max-width: 992px) {
	.ren-article-wrap .ren-main-left { width: 100% !important; float: none !important; }
}

/* article list rows read as cards */
.ren-cat-list-li, .rc-e15-ng {
	border-radius: var(--m58-radius-sm);
	transition: background .15s ease;
}
.ren-cat-list-li:hover { background: var(--m58-bg); }

@media (max-width: 992px) {
	.ren-main-mn.ren-main-left,
	.ren-list-right-g .ren-main-left,
	.ren-forumdisplay .ren-list-right-k .ren-main-left {
		width: 100% !important; float: none !important;
	}
	.ren-main-right,
	.ren-viewthread .ren-main-right,
	.ren-main-right .ren-index-right-yi,
	.ren-index-main .ren-main-right .ren-index-right-yi {
		width: 100% !important; float: none !important; margin-top: 16px;
	}
	.ren-viewthread .ren-main-right .rc-e2-ndiy a img,
	.ren-viewthread .ren-main-right .rc-e2-ndiy a span { width: 100% !important; height: auto !important; }
	.ren-about-index .ren-cat-list-li .rc-e17-ng { width: 100% !important; }
}

@media (max-width: 768px) {
	/* list row: thumbnail scales, text wraps */
	.ren-cat-list-li img, .rc-e15-ng img { max-width: 40%; height: auto !important; }
	.rc-e16-ng, .rc-e17-ng { width: 100% !important; float: none !important; }
}

/* group index right column + tag cloud */
@media (max-width: 992px) {
	#group_index .y[style], .group_r { width: 100% !important; float: none !important; }
	.tagcloudtop { line-height: 2.2; word-break: break-word; }
}

/* post/reply editor page */
@media (max-width: 768px) {
	#postbox, .pbox { width: auto !important; }
	#e_controls, .edt .bar { overflow-x: auto; white-space: nowrap; }
	#e_textarea, .area textarea.pt { width: 100% !important; box-sizing: border-box; }
	.exfm th { width: auto !important; }
	#post_extra_c .exfm, .psth { overflow-x: auto; }
}

/* ==========================================================================
   Main nav — out-specify the legacy #nv.navbar blue-block rules
   ========================================================================== */

#nv.navbar {
	background: var(--m58-surface) !important;
	height: auto !important;
	border-bottom: 1px solid var(--m58-border);
	overflow: visible !important;
	position: sticky;
	top: 0;
	z-index: 200;
}
#nv.navbar .navbar-collapse {
	width: auto !important;
	max-width: var(--m58-maxw) !important;
	margin: 0 auto;
	overflow: visible !important;
}
#nv.navbar .navbar-collapse .navbar-nav li {
	width: auto !important;
	height: auto !important;
	line-height: 1.4 !important;
	border: none !important;
	background: none !important;
}
#nv.navbar .navbar-collapse .navbar-nav li a {
	float: none !important;
	width: auto !important;
	height: auto !important;
	line-height: 1.4 !important;
	padding: 14px 20px !important;
	font-size: 16px !important;
	font-weight: 500;
	color: var(--m58-text) !important;
	background: none !important;
	position: relative;
}
#nv.navbar .navbar-collapse .navbar-nav li a:hover {
	background: none !important;
	color: var(--m58-primary) !important;
}
#nv.navbar .navbar-collapse .navbar-nav .a,
#nv.navbar .navbar-collapse .navbar-nav .a a {
	background: none !important;
	color: var(--m58-primary) !important;
	font-weight: 600;
}
#nv.navbar .navbar-collapse .navbar-nav .a a::after {
	content: "";
	position: absolute;
	left: 20px; right: 20px; bottom: 0;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--m58-primary);
}

/* sub-nav strip under the main nav (if enabled) */
#mu { background: var(--m58-bg); border-bottom: 1px solid var(--m58-border); }
#mu ul { max-width: var(--m58-maxw); margin: 0 auto; }

/* site logo */
.m58-logo { max-height: 56px; width: auto; display: block; }
@media (max-width: 768px) { .m58-logo { max-height: 40px; } }

/* widthauto/min-width stragglers */
#wp, #hd .wp,
.min-1200, .min-1250 { min-width: 0 !important; }
.w-1200 { width: auto !important; }
.mw-1200 { max-width: var(--m58-maxw) !important; }

/* Discuz compiled core css sets body{min-width:1200px} — kill for responsive */
html, body { min-width: 0 !important; }

/* mobile: contain nav scroll and fluid search box */
@media (max-width: 768px) {
	#nv.navbar .navbar-collapse { overflow-x: auto !important; overflow-y: hidden !important; }
	.rtj1009-sousuo, .rtj1009-sousuo2 { width: auto !important; max-width: 100% !important; float: none !important; }
	.rtj1009-sousuo input[type="text"] { width: 100% !important; box-sizing: border-box; }
	.ren-header-centre h3 { float: none; }
}

/* forum search bar fluid on small screens */
@media (max-width: 768px) {
	#scbar, #scbar table, #scbar .scbar_txt_td { width: 100% !important; box-sizing: border-box; }
	#scbar_txt { width: 100% !important; }
	#scbar .scbar_type_td, #scbar .scbar_hot { display: none; }
}

/* forum index: sidebar holds only empty DIY placeholders — reclaim the space */
.ren-forums-sd { display: none !important; }
.ren-forums-mn, .ren-forums-sd-kai .ren-forums-mn { width: 100% !important; float: none !important; }

/* search results page: kill fixed 1500px container */
#nv_search #ct, #nv_search .wp, #ct.w {
	width: auto !important;
	max-width: var(--m58-maxw) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}
