/*
 * 趋势块：24 小时热文 + 标签星球
 *
 * 只负责这两块自己的样式；卡片外框、标题、内边距都沿用主题的 .widget 规则，
 * 换主题时这里不会跟主题打架。
 */

/* =============== 24 小时热文（左图右文，5 条） =============== */

/*
 * 这里的每条选择器都带上 .sidebar .widget ul 前缀，不是啰嗦：
 * 主题 style.css 里有三条会打到这个列表上——
 *   .sidebar .widget ul > li        → padding-left: 14px
 *   .sidebar .widget ul > li:before → 一个 4×4 的灰色小圆点
 *   .sidebar .widget ul > li a      → 链接颜色
 * 它们的特异性是 2 个类 + 3 个元素，只用 .goaita-hot24 这类单个类是压不住的，
 * 圆点会一直在、图片还会被左边那 14px 顶开。加上同样的前缀才能平行对上，
 * 所以这一段看着重复，其实每一条都是必需的。
 */

.sidebar .widget ul.goaita-hot24,
.goaita-hot24 {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* 每一条：图左文右，去掉主题的点、缩进和位置偏移 */
.sidebar .widget ul.goaita-hot24 > li,
.goaita-hot24 > li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 10px;
	padding: 0;
	border: none;
	list-style: none;
	position: static;
	overflow: visible;
}

/* 主题的小圆点是 ::before 画出来的，这里连 after 一起关掉 */
.sidebar .widget ul.goaita-hot24 > li:before,
.sidebar .widget ul.goaita-hot24 > li:after,
.goaita-hot24 > li:before,
.goaita-hot24 > li:after {
	content: none;
	display: none;
	background: none;
	width: 0;
	height: 0;
}

.sidebar .widget ul.goaita-hot24 > li:last-child,
.goaita-hot24 > li:last-child {
	margin-bottom: 0;
}

/* 缩略图：固定 88×60，圆角裁切，比例统一就不会参差不齐 */
.sidebar .widget ul.goaita-hot24 > li a.goaita-hot24-thumb,
.goaita-hot24-thumb {
	display: block;
	flex: none;
	width: 88px;
	height: 60px;
	border-radius: 4px;
	overflow: hidden;
	background: #f2f4f7;
	text-decoration: none;
	border-bottom: none;
}

.goaita-hot24-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}

/* 没有图时的占位：淡底 + 标题首字，比空框体面 */
.goaita-hot24-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 700;
	color: #c3cad4;
	background: linear-gradient(135deg, #f6f8fb 0%, #eef2f7 100%);
}

.goaita-hot24-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
	/* 让标题和缩略图顶端对齐，视觉上是一行 */
	padding-top: 1px;
}

.sidebar .widget ul.goaita-hot24 > li a.goaita-hot24-t,
.goaita-hot24-t {
	color: #222;
	font-size: 14px;
	line-height: 1.45;
	text-decoration: none;
	border-bottom: none;
	/* 两行截断：五条标题长短不一，不截会把卡片拉得很长 */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color .15s;
}

.sidebar .widget ul.goaita-hot24 > li a.goaita-hot24-t:hover,
.goaita-hot24-t:hover {
	color: #e5484d;
	text-decoration: none;
}

.goaita-hot24-m {
	color: #a0a8b4;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	/* 栏目和时间分成两段，用间距隔开，不放间隔点 */
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.goaita-hot24-cat {
	color: #8b95a3;
	flex: none;
	max-width: 50%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.goaita-hot24-time {
	color: #b3bac4;
	flex: none;
}

/* =============== 标签星球 =============== */

/*
 * 默认（没有 JS）：一片可换行的标签胶囊。
 * JS 到位后加上 .is-live，才切换成 3D 球面排布。
 * 这样脚本被缓存插件挡掉时，这块退化成普通标签云，不会空着。
 */
.goaita-globe {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	padding: 2px 0 0;
}

.goaita-globe .goaita-globe-tag {
	display: inline-block;
	padding: 5px 10px;
	border: 1px solid #eaeef4;
	border-radius: 999px;
	background: #f5f7fa;
	color: #4a5568;
	font-size: 13px;
	line-height: 1;
	text-decoration: none;
	transition: color .15s, border-color .15s, background .15s;
}

.goaita-globe .goaita-globe-tag:hover {
	border-color: #ffd0d0;
	background: #fff1f1;
	color: #e5484d;
}

/* 轨道圈：球面背后的一层淡淡同心圆，让「这是个球」有落点 */
.goaita-globe-orbit {
	display: none;
}

/* --- 进入 3D 模式 --- */

.goaita-globe.is-live {
	display: block;
	height: 218px;
	gap: 0;
	overflow: hidden;
	border-radius: 10px;
	background: radial-gradient(closest-side at 50% 50%, #f7f9fc 0%, #fdfefe 70%, #ffffff 100%);
}

.goaita-globe.is-live .goaita-globe-orbit {
	display: block;
	position: absolute;
	left: 50%;
	top: 50%;
	width: 84%;
	height: 84%;
	margin: -42% 0 0 -42%;
	border: 1px solid #eef1f6;
	border-radius: 50%;
	pointer-events: none;
}

.goaita-globe.is-live .goaita-globe-orbit:after {
	content: '';
	position: absolute;
	inset: 18%;
	border: 1px dashed #f1f4f8;
	border-radius: 50%;
}

.goaita-globe.is-live .goaita-globe-tag {
	position: absolute;
	left: 50%;
	top: 50%;
	padding: 0;
	border: none;
	border-radius: 0;
	background: none;
	white-space: nowrap;
	will-change: transform, opacity;
	transform: translate(-50%, -50%);
	backface-visibility: hidden;
	text-shadow: 0 1px 0 #fff;
}

/* 五档字重 / 颜色：越小越浅，越大越红 */
.goaita-globe.is-live .goaita-globe-tag[data-w="1"] {
	font-size: 12px;
	color: #9aa4b2;
}

.goaita-globe.is-live .goaita-globe-tag[data-w="2"] {
	font-size: 13px;
	color: #7b8695;
}

.goaita-globe.is-live .goaita-globe-tag[data-w="3"] {
	font-size: 14px;
	color: #55606f;
}

.goaita-globe.is-live .goaita-globe-tag[data-w="4"] {
	font-size: 15px;
	color: #333d4b;
	font-weight: 600;
}

.goaita-globe.is-live .goaita-globe-tag[data-w="5"] {
	font-size: 17px;
	color: #e0454a;
	font-weight: 700;
}

.goaita-globe.is-live .goaita-globe-tag:hover {
	color: #e0454a;
	text-decoration: none;
}

/* 用户要求减少动效：只排一次版，不转 */
@media (prefers-reduced-motion: reduce) {
	.goaita-globe.is-live .goaita-globe-tag {
		will-change: auto;
	}
}

/* =============== 侧栏三块的尺寸微调 =============== */

/*
 * 三块加起来比一屏略高时，吸顶之后最下面那块会被裁掉一截。
 * 这里把几处尺寸收一点，让总高尽量落在一屏内（1440×900 下约 1000）：
 * 广告从 270 见方收到 244，热文图 88×60、行距 10，
 * 标签球 218 —— 都还在正常阅读尺寸，没有为了塞进一屏而牺牲可读性。
 */
.sidebar .goaita-trend-ad {
	padding: 12px;
}

.sidebar .goaita-trend-ad .goaita-dy-ad {
	max-width: 244px;
	margin: 0 auto;
}

.sidebar .goaita-trend-widget {
	padding: 13px 15px;
}

.sidebar .goaita-trend-widget .widget-title {
	margin-bottom: 13px;
}

/* =============== 桌面：热文和标签常驻视野 =============== */

/*
 * 门户的右栏是「常驻」的：往下翻文章，右边一直在，翻到底也还有东西可点。
 * 主题原来把 #secondary 当成普通 float，正文一长右栏就整个滚出屏幕，
 * 拉到最下面右边是白的。
 *
 * 但整栏一起吸顶也不对：最上面那块是大盘云图广告，
 * 它属于首屏，滚过去就该让位，一直粘在顶部等于每屏都在重复同一张。
 * 所以拆成两段：
 *   .goaita-trend-ad   → 普通流，跟页面一起滚走；
 *   .goaita-trend-flow → sticky，广告滚出去以后停在顶部。
 *
 * 为什么 sticky 放在内层这一块而不是 #secondary 上：
 * #secondary 一旦 sticky，里面的广告也会被带着一起粘住，分不开。
 * 内层 sticky 需要父级有足够高度，脚本会给 #secondary 补一个 min-height
 * （等于正文栏的高度），否则它只有「广告 + 两块」那么高，
 * 滚动空间只有广告那 300px，等于没吸住。脚本没跑起来时这段
 * 退化成「不吸顶」，只是右栏跟着页面滚，不会错位。
 */
@media only screen and (min-width: 960px) {
	.sidebar .goaita-trend-flow {
		position: -webkit-sticky;
		position: sticky;
		/* 由脚本按实际高度写进 --goaita-flow-top；默认 16px 就是普通吸顶 */
		top: var(--goaita-flow-top, 16px);
		z-index: 2;
	}
}

/* =============== 手机端的趋势块 =============== */

/*
 * 主题在 960px 以下隐藏了 #secondary，右侧栏的版本在手机上一片空白。
 * footer.php 里挂了一份同样的内容，桌面上藏起来，手机上显示成三张卡片。
 */
.goaita-trend-mobile {
	display: none;
}

@media only screen and (max-width: 959px) {
	.goaita-trend-mobile {
		display: block;
		margin: 26px 0 4px;
		padding: 0 10px;
	}

	/* 卡片外框照着侧栏 .widget 的样式来，手机上看起来是同一种卡片。
	   用后代选择器而不是 > ：热文和标签外面包了一层 .goaita-trend-flow（吸顶用），
	   它们已经不是 .goaita-trend-mobile 的直接子元素了。 */
	.goaita-trend-mobile .goaita-trend-widget {
		background: #fff;
		border: 1px solid #e9e9e9;
		border-radius: 8px;
		padding: 15px;
		margin-bottom: 16px;
	}

	.goaita-trend-mobile .widget-title {
		position: relative;
		margin: 0 0 14px;
		color: #333;
		font-size: 16px;
		line-height: 1;
	}

	.goaita-trend-mobile .widget-title span {
		position: relative;
		display: inline-block;
		padding-left: 14px;
	}

	.goaita-trend-mobile .widget-title:before {
		content: '';
		position: absolute;
		left: 0;
		top: 1px;
		width: 4px;
		height: 15px;
		border-radius: 1px;
		background: #e5484d;
	}

	/* 广告卡不要外框，正方形自己就是一整块 */
	.goaita-trend-mobile .goaita-sb-ad {
		border: none;
		padding: 0;
		background: none;
		margin-bottom: 16px;
	}

	/* 手机上给热文留大一点的图，一行两行都还看得清 */
	.goaita-trend-mobile .goaita-hot24-thumb {
		width: 104px;
		height: 74px;
	}

	.goaita-trend-mobile .goaita-hot24-t {
		font-size: 15px;
	}

	.goaita-trend-mobile .goaita-globe.is-live {
		height: 230px;
	}
}
