/* ==========================================================================
   管理资源网移动端（M 站）专属样式 2026-11-24 新增
   为什么单独一个文件：public/Public/static/css/common.css 被主站与培训圈
   （Quanzi/view/public/meta_m.html）共用，属于公用文件，不为 M 站单独的需求改动。
   本文件仅在 M 站模板（app/M/view/pub/_meta.html）中引入。
   ========================================================================== */

/* --------------------------------------------------------------------------
   零、配色方案声明（2026-11-24 补，站长反馈"手机上 logo 是透明的"）
   根因：站长手机开了系统深色模式，Chromium 内核浏览器（Edge/Chrome）对未声明
        color-scheme 的网页会启用"自动深色"：白底顶栏被反色成黑底，而 logo 是
        透明底 PNG + 深蓝色文字，反色后文字与背景几乎同色，看起来就像"透明"。
        同理整页的白色卡片也全被反成了黑底（见截图）。
   修法：声明页面只提供浅色主题，浏览器即放弃自动反色。这是 Chromium 官方
        文档给的唯一站点级关闭方式，对正常浅色模式的手机无任何视觉影响。
   -------------------------------------------------------------------------- */
:root {
	color-scheme: only light;
}

/* --------------------------------------------------------------------------
   一、H1 标题样式归一
   背景：检索页原本用 <div class="sub-title">，2026-11-24 改语义为 <h1> 以便
        搜索引擎识别页面主题。浏览器对 h1 有默认 margin-bottom，会把原来的
        间距撑开，这里显式归零，保证视觉与改版前一致。
   -------------------------------------------------------------------------- */
h1.sub-title {
	margin-bottom: 0;
}

/* 首页 H1：视觉上不喧宾夺主，但保留在文档结构里供搜索引擎识别。
   ★ margin-top:56px 是关键 —— common.css 里 body 的 padding-top 只有 60px，
     只够盖住"单行顶栏"（logo 行 56px，检索页/详情页都是这种）。
     而首页顶栏是两行（logo 行 56px + 搜索框行 56px = 116px），
     原来首页的功能入口 .index-export（margin-top:8px）其实是被搜索框压住了 48px，
     这是既有问题。
     这里让 H1 用 margin-top:56px 顶开搜索框那行，H1 就落在 116px 处，
     既补上了首页原有的那段遮挡，也让 H1 完整可见。 */
h1.m-index-h1 {
	font-size: 16px;
	font-weight: bold;
	color: #333;
	margin: 56px 0 10px 0;
	padding: 10px;
	border-left: 5px solid var(--secondary);
	border-radius: 4px;
	background-color: #fff;
	line-height: 1.5;
}

h1.m-index-h1 span {
	font-weight: normal;
	font-size: 13px;
	color: #888;
	margin-left: 6px;
}

/* H1 副标题在窄屏下的溢出处理：
   span 是 inline 元素，长文字不换行时会直接溢出屏幕（375px 下实测被截断）。
   改成 inline-block + 允许换行，并让整行能正常折行。 */
@media (max-width: 480px) {
	h1.m-index-h1 {
		line-height: 1.6;
	}

	h1.m-index-h1 span {
		display: block;
		margin-left: 0;
		margin-top: 2px;
		font-size: 12px;
	}
}

/* H1 之后的首页首个模块（功能入口）留出间距。
   common.css 里 .index-export 的 margin-top 只有 8px，
   加上 H1 后会显得很挤，这里补到 12px。 */
.index-export {
	margin-top: 12px;
}

/* --------------------------------------------------------------------------
   一之二、详情页标题层级修正（2026-11-24）
   背景：详情页原来是 h1 → h5（元信息行）→ h4（元信息项标题），
        层级跳级严重，搜索引擎对层级混乱的页面会打折。
        改法：h5 → p（.meta-line），h4 → h3。
        common.css 里样式绑在 h5 / .meta-content h4 选择器上，改标签会掉样式，
        所以这里补等价规则，保证视觉与改版前完全一致。
   -------------------------------------------------------------------------- */
/* 顶栏元信息行（原 h5 → 现 p.meta-line） */
.detaile-content .top p.meta-line {
	font-weight: normal;
	line-height: 40px;
	margin: 0;
	font-size: 14px;
	color: #7f8c8d;
}

/* 元信息项标题（原 h4 → 现 h3） */
.meta-content h3 {
	font-size: 12px;
	color: #7f8c8d;
	font-weight: 500;
	margin: 0;
}

/* --------------------------------------------------------------------------
   二、分页条
   背景：2026-11-24 分页改为公共片段 pub/_pages.html，加入首末页、数字页、
        省略号，原样式只有上一页/下一页。
   -------------------------------------------------------------------------- */
.pages .ellipsis {
	display: inline-block;
	padding: 0 6px;
	color: #999;
	font-size: 14px;
	line-height: 2.5;
}

.pages a,
.pages span.cur {
	display: inline-block;
	margin: 0 3px;
}

/* 数字页里的当前页高亮 */
.pages span.cur {
	color: #fff;
	background: var(--secondary);
	border-radius: 3px;
	padding: 0 8px;
	line-height: 24px;
}

/* 页码信息（"第 X / Y 页"）不要跟当前页高亮混为一谈 */
.pages .page-info {
	display: inline-block;
	margin: 0 3px;
	color: #666;
	font-size: 14px;
	line-height: 24px;
}

/* --------------------------------------------------------------------------
   三、相关讲师 / 相关课程（横向内链区块）
   背景：2026-11-24 新增。讲师详情页此前除六宫格 tab 外无任何横向内链，
        页面在站内是孤岛，权重无法流动。
   -------------------------------------------------------------------------- */
.m-related {
	margin-top: 12px;
}

.m-related-title {
	font-size: 15px;
	font-weight: bold;
	color: #333;
	padding: 10px;
	border-left: 5px solid var(--secondary);
	border-radius: 4px;
	background-color: #fff;
	margin-bottom: 10px;
}

.m-related-list {
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
}

.m-related-item {
	display: flex;
	align-items: center;
	padding: 10px;
	border-bottom: 1px solid #f0f0f0;
}

.m-related-item:last-child {
	border-bottom: none;
}

.m-related-item img {
	width: 50px;
	height: 50px;
	border-radius: 4px;
	object-fit: cover;
	flex-shrink: 0;
	margin-right: 10px;
	background: #f5f5f5;
}

.m-related-info {
	flex: 1;
	min-width: 0;
}

.m-related-name {
	font-size: 14px;
	color: #333;
	font-weight: bold;
	margin-bottom: 4px;
}

.m-related-name a {
	color: #333;
}

.m-related-desc {
	font-size: 12px;
	color: #888;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ==========================================================================
   四、宽屏适配（2026-11-24 新增，站长反馈"页面变形严重"）

   ★ 问题根因（都是 common.css 的既有设计，M 站从未做过宽屏适配）：
     1) body 写了 max-width:750px 但没有 margin:auto
        → 750px 的内容区在 1080px 屏幕上靠左挤着，右侧一大片空白；
     2) .header 是 position:fixed + width:100%
        → 固定定位相对视口而非 body，顶栏横跨整个屏幕，与下面的内容脱节；
     3) .bottom-nav / .detail-bottom 是 fixed + max-width:480px + margin:0 auto
        → 居中在"屏幕"中而不是"内容区"中，底栏跑到页面右侧（截图里正是这样）；
     4) .search-box 的 form 没有宽度约束，输入框 flex:1 把「搜索」按钮挤出可视区。

   ★ 改法与边界：
     - 全部规则包在 @media (min-width: 751px) 里，
       手机屏（≤750px）一个字节都不受影响，零回归风险；
     - 只改本文件（mobile.css，M 站专属），common.css 一字不动
       ——common.css 被主站与培训圈共用；
     - 做法是让 fixed 元素也跟随 body 的 750px 内容区居中，
       而不是把内容区拉宽 —— 手机站的版式是按 375~414px 设计的，
       拉宽反而会让一行两列的卡片、图标排布全部走形。
   ========================================================================== */
@media (min-width: 751px) {

	/* 1) 内容区水平居中，右侧不再留白 */
	body {
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	/* 2) 顶栏跟随内容区（不再横跨整个屏幕）
	   common.css 里 .header 是 position:fixed + width:100%，固定定位以视口为基准，
	   这里保持 fixed（保留滚动吸顶的原有体验），改用
	   left:50% + translateX(-50%) + width:750px 让它与内容区对齐居中。
	   固定定位的 containing block 是视口，所以 left:50% 是屏幕中心，
	   translateX(-50%) 再把自身 750px 宽度往回拉一半 → 与 body 内容区完全重合。 */
	.header {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		width: 750px;
		max-width: 100%;
	}

	/* 3) 底部导航跟随内容区居中（原来居中在屏幕上，跑到页面右边去了）
	   注意保持原有的 max-width:480px 窄底栏设计 —— 底栏是 5 个按钮的紧凑条，
	   拉宽到 750px 会改变设计观感，这里只修正它的"居中基准"：
	   从"屏幕居中"改成"内容区（750px）居中"。
	   left:50% + translateX(-50%) 已能完成居中，margin:0 auto 会与之打架，这里去掉。 */
	.bottom-nav {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		width: 480px;
		max-width: 100%;
	}

	/* 4) 详情页底部操作条同样跟随内容区居中（保持原有 480px 宽度） */
	.detail-bottom {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		width: 480px;
		max-width: 100%;
	}

	/* 5) 搜索框：输入框与按钮都要有宽度约束，按钮不再被挤出可视区 */
	.search-box form {
		display: flex;
		width: 100%;
		align-items: center;
	}

	.search-box input.sear-input {
		flex: 1 1 auto;
		min-width: 0;
		height: 32px;
	}

	.search-box button.sear-submit {
		flex: 0 0 auto;
		height: 32px;
		padding: 0 14px;
		white-space: nowrap;
	}

	/* 6) 讲师照片变形修复（2026-11-24，站长反馈"电脑上看讲师照片变形了"）
	   根因：common.css 里 .lecturer-img img 写死 height:160px + width:100%。
	        手机上卡片约 165px 宽，拉伸幅度小看不出来；宽屏下内容区 750px，
	        每张卡片约 340px 宽，照片被从 3:4 硬拉成 340x160 的横条，人物明显变形。
	   第一版只加 object-fit:cover 翻车了：340x160 的横图框配竖版照片，
	        cover 会放大裁切只露出头顶，站长反馈"更严重了"，已废弃。
	   最终修法：宽屏下把图框本身改成照片的自然比例（3:4 竖版），
	        再配 cover 兜底 —— 竖版照片几乎完整显示，横版照片只裁左右两侧，
	        任何照片都不再变形；常驻地角标从 top:132px 改到图片底部。
	   边界：包在 min-width:751px 里 —— 手机端（≤750px）零改动，维持现状。 */
	.lecturer-img {
		height: auto;
		aspect-ratio: 3 / 4;
	}

	.lecturer-img img {
		height: 100%;
		width: 100%;
		object-fit: cover;
		object-position: center top;
	}

	/* 检索页/详情页的图片外还包着一层 <a>，img 的 height:100% 是相对它算的，
	   必须把这层也撑满图框，比例链才通（首页的 <a> 在图框外层，不受影响） */
	.lecturer-img a {
		height: 100%;
	}

	.lecturer-img .area {
		top: auto;
		bottom: 0;
	}
}
