/*********************************************************************
* pp.ruanchina.com 响应式增强 (responsive.css)
* 目标：与论坛 bbs.ruanchina.com 尺寸对齐(1200px 版心 / 13px 微软雅黑)
*       并支持平板 / 手机自适应
* 注意：本文件必须最后加载
*********************************************************************/

/* ---------- 全站字号对齐论坛 (13px 微软雅黑) ---------- */
body, form, ul, li, p, dl, dd, dt, td, th, h3, input, button, select, textarea {
	font-family: 'Microsoft Yahei', 'SimSun', sans-serif;
	font-size: 13px;
	line-height: 1.5;
}
a { font-size: 13px; }
body { -webkit-text-size-adjust: 100%; }

/* ---------- 基础防溢出 ---------- */
img { max-width: 100%; height: auto; }
embed, object, video { max-width: 100%; }
.wrap { box-sizing: border-box; }
table { border-collapse: collapse; }

/* 桌面宽屏：头部 990 定宽 table 拉到 1200 与论坛一致 */
@media (min-width: 1241px) {
	table[width="990"] { width: 1200px !important; }
}

/* ---------- 中屏 (平板横竖屏) ---------- */
@media (max-width: 1240px) {
	.wrap,
	table[width="990"],
	table[width="980"],
	table[width="850"],
	#topsearchtb,
	.Index_srow_ad {
		width: 96% !important;
		max-width: 1200px;
		box-sizing: border-box;
	}
	.index_silder,
	.brand_slide,
	.hy_main_ad,
	div.SlidzhBox,
	div.second_ad {
		max-width: 100% !important;
	}
	#footer { padding-left: 10px !important; }
}

@media (max-width: 1000px) {
	/* 首页新闻双栏改单栏 */
	.ContSide_2 .c .Mlistp_w { width: 48% !important; }
	.ContSide_2 .c .Mlistt_d { width: 48% !important; }
}

/* ---------- 手机 ---------- */
@media (max-width: 768px) {
	img { max-width: 100% !important; height: auto !important; }
	/* 老幻灯 (document.write 内联 380px) 缩放 */
	#pic { width: 100% !important; height: auto !important; }
	div[style*="overflow:hidden"] { width: 100% !important; height: auto !important; }

	iframe, object, embed { max-width: 100% !important; }

table[width], td[width], th[width] { width: auto !important; }
	body {
		-webkit-text-size-adjust: 100%;
		font-size: 14px;
	}

	/* 版心通栏 */
	.wrap,
	table[width="990"],
	table[width="980"],
	table[width="850"],
	#topsearchtb,
	.Index_srow_ad {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
		padding-left: 8px;
		padding-right: 8px;
	}
	/* 全局防横向溢出兜底 */
	body { overflow-x: hidden; }

	/* 表格布局堆叠化 (不用 !important 的 display，保住 JS 显隐) */
	table, tbody, thead, tfoot, tr, td, th {
		display: block;
		width: 100% !important;
		box-sizing: border-box;
	}
	tr { height: auto !important; }
	td, th {
		height: auto !important;
		padding: 4px 2px !important;
	}

	/* 常见栅格 / 浮动元素取消浮动 */
	.MainDivTable .Main, .MainDivTable .Side,
	.MainTable .Main, .MainTable .Side,
	.MainTable .dragTable, .MainTable .Side .dragTable,
	.MainTable .listpic, .MainTable .list_sortTCP,
	.ContSide_2 .c .Mlistp_w, .ContSide_2 .c .Mlistt_d,
	.ContSide_2 .c .bbspicowrd .Mlistp_w,
	.ContSide_2 .c .listd, .ContSide_2 .c .liste,
	table.ContSide .c .cont .list, table.ContSide .c .listc,
	.index_silder, .brand_slide, .hy_main_ad, div.SlidzhBox,
	div.second_ad, .NewsSide, #Mune3, #Mune4, #Mune5 {
		float: none !important;
		width: 100% !important;
		max-width: 100%;
	}
	.ContSide_2 .c .Mlistp_w { border-right: 0 !important; }

	/* 顶部通条：浮动清理，防止高度塌陷重叠 */
	#header_login, #header_logo, #header_menu {
		height: auto !important;
	}
	#header_login td, #header_logo td {
		display: block;
	}
	#header_login td:after, #header_logo td:after {
		content: '';
		display: block;
		clear: both;
	}
	#header_login #top_login {
		float: none !important;
		margin-left: 0 !important;
		max-width: 100%;
		overflow-x: auto;
	}
	#header_login #top_login .login_form {
		margin-top: 0;
		white-space: nowrap;
	}
	#header_login #top_help, #header_login #top_link {
		float: none !important;
		display: inline-block;
		margin: 2px 8px 2px 0;
		line-height: 22px;
	}
	#header_logo {
		height: auto !important;
	}
	#header_logo .logo {
		float: none !important;
		margin: 0 auto;
		background-size: contain;
		background-position: center;
		height: 72px;
	}
	#header_logo .logo_menu {
		float: none !important;
		text-align: center;
		height: auto !important;
		overflow: hidden;
	}
	#header_logo .logo_menu a {
		display: inline-block !important;
		float: none !important;
		margin: 6px 4px 0 4px;
	}

	/* 主导航横向滑动 */
	#header_menu { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	#header_menu td {
		white-space: nowrap;
		display: block;
		overflow-x: auto;
		height: 35px !important;
		padding: 0 !important;
	}
	#header_menu a {
		float: none !important;
		display: inline-block !important;
		vertical-align: top;
	}

	/* 头部搜索栏 */
	#topsearchtb {
		height: auto !important;
	}
	#topsearchtb .formleft, #topsearchtb .keyword,
	#topsearchtb .submit, #topsearchtb .brand, #topsearchtb .hotsearch,
	#topsearchtb .serchl, #topsearchtb .serchr {
		float: none !important;
		width: 100% !important;
		margin: 4px 0 !important;
	}
	#topsearchtb .hotsearch {
		overflow: hidden;
		white-space: normal;
		word-break: break-all;
		line-height: 1.8;
		height: auto !important;
		padding: 2px 0 !important;
	}
	#topsearchtb .hotsearch a { display: inline-block; margin-right: 6px; }
	#topsearchtb .serchl table { width: 100% !important; }
	#topsearchtb .formleft { width: 100% !important; }
	#topsearchtb .keyword input { width: 96% !important; }
	#topsearchtb .serchr #subbtn { width: 40% !important; }
	#header_search #search_input, #header_search #search_input input {
		width: 100% !important;
		box-sizing: border-box;
	}

	/* 页脚 */
	#footer {
		height: auto !important;
		padding: 10px 8px !important;
		line-height: 2;
	}
	#Footsearchinput span.input input { width: 96% !important; }

	/* 文字链 / 词链换行 */
	.wordlink a, .friendlink a { display: inline-block; margin: 2px 4px 2px 0; }

	/* 幻灯高度随宽收缩 (原 470x200 比例) */
	.index_silder { height: auto !important; }
	.index_silder img { width: 100%; height: auto; }
	.NewsSide { height: auto !important; }

	/* 列表内图片行 */
	.dragTable .cont .info { width: 100% !important; }
	.MainTable .listpic .img a, .MainTable .listpic img { width: 100% !important; height: auto !important; }

	/* 表单控件防溢出 */
	input[type="text"], input[type="password"], input:not([type]), textarea, select {
		max-width: 96% !important;
		box-sizing: border-box;
	}
	textarea { width: 96% !important; }

	/* 防止绝对定位组件在窄屏溢出 */
	#listselect { width: 90px; }
}

/* ---------- 超小屏 ---------- */
@media (max-width: 400px) {
	body { font-size: 13px; }
	#header_menu a { padding: 8px 10px 0 10px; }
}
