/*
	中国平台社交图标样式。
	配色与交互效果对齐参考站做法：40px 圆形、半透明白底、悬停放大并换成品牌色。

	为什么不用 <ul class="icons">：那是模板自带的样式，会给每个图标套一圈白边线框，
	和参考站那种"实心色块圆形"不一样。这里用自定义的 .brand-icon 独立控制。

	图标来源说明：
		抖音 → Font Awesome 5 的 fa-tiktok（抖音图标的基础就是 TikTok，视觉一致）
		微信 → Font Awesome 5 的 fa-weixin
		哔哩哔哩 / 小红书 → **Font Awesome 5 里没有这两个品牌**，
		                    原来只能拿 fa-play / fa-bookmark 顶替，视觉不对。
		                    现改为自托管的官方 logo SVG：images/icons/bilibili.svg
		                    与 images/icons/xiaohongshu.svg（取自 Simple Icons，
		                    24x24 标准网格，fill 用 currentColor 以继承徽章白色）。
		                    见下方 .brand-icons a img.brand-svg 的样式。
*/

.brand-icons {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 2.5rem 0 0 0;
	padding: 0;
	list-style: none;
}

	.brand-icons a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 2.5rem;
		height: 2.5rem;
		border-radius: 100%;
		background-color: rgba(255, 255, 255, 0.1);
		color: #ffffff;
		font-size: 1.1rem;
		border-bottom: 0;
		transition: background-color 0.3s ease, transform 0.3s ease;
	}

		.brand-icons a:hover {
			background-color: rgba(255, 255, 255, 0.2);
			transform: scale(1.1);
		}

		.brand-icons a .label {
			display: none;
		}

	/*
		显式声明字体族，不依赖 FA 工具类的默认行为。
		FA5 的字形分散在两个字体文件里：品牌图标在 "Font Awesome 5 Brands"，
		通用图标在 "Font Awesome 5 Free"（solid 需要 font-weight:900）。
		字体族写错 = 字形不存在 = 显示成空白方块。
	*/
	.brand-icons a i.fa-brands {
		font-family: "Font Awesome 5 Brands";
		font-weight: 400;
		font-style: normal;
	}

	.brand-icons a i.fa-solid {
		font-family: "Font Awesome 5 Free";
		font-weight: 900;
		font-style: normal;
	}

	/*
		品牌 SVG 图标（B站、小红书）。
		Font Awesome 5 没有这两个品牌，原来只能拿 fa-play / fa-bookmark 顶替，
		视觉上不对。现在用自托管的官方 logo（images/icons/*.svg，取自 Simple Icons），
		24x24 标准网格，fill="currentColor" 所以自动继承徽章的白色。

		尺寸 1.1rem 与旁边的 FA 图标（font-size: 1.1rem）对齐；
		display:block 去掉行内元素底部的基线空隙。
	*/
	.brand-icons a img.brand-svg {
		width: 1.1rem;
		height: 1.1rem;
		display: block;
		border: 0;
	}

	/* 品牌色（与参考站一致） */
	.brand-icons a.icon-bilibili      { background-color: #fb7299; }
	.brand-icons a.icon-bilibili:hover { background-color: #e65d85; }
	.brand-icons a.icon-douyin        { background-color: #000000; }
	.brand-icons a.icon-douyin:hover  { background-color: #333333; }
	.brand-icons a.icon-weixin        { background-color: #07c160; }
	.brand-icons a.icon-weixin:hover  { background-color: #06ad56; }
	.brand-icons a.icon-xiaohongshu   { background-color: #ff3344; }
	.brand-icons a.icon-xiaohongshu:hover { background-color: #e62e3d; }

/*
	微信二维码排版（VIP 卡片用）。
	两张贴并排，窄屏自动换行；白色衬底在暗色卡片里更清晰，也便于直接扫码。
	注意：图片不能加任何滤镜或透明度，否则会影响识别率。
*/
	.qr-row {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 1.5rem;
		margin: 2rem 0 1rem 0;
	}

	.qr-item {
		margin: 0;
		text-align: center;
		flex: 0 1 auto;
	}

		.qr-item a {
			display: inline-block;
			border-bottom: 0;
			line-height: 0;
		}

		.qr-item img {
			display: block;
			width: 12rem;
			max-width: 100%;
			height: auto;
			border-radius: 6px;
			background-color: #ffffff;
			transition: transform 0.2s ease;
		}

		.qr-item a:hover img {
			transform: scale(1.03);
		}

		.qr-item figcaption {
			margin-top: 0.6rem;
			font-size: 0.8rem;
			letter-spacing: 0.05rem;
			opacity: 0.85;
			word-break: break-all;
		}

	.qr-hint {
		font-size: 0.8rem;
		opacity: 0.7;
		text-align: center;
		margin-bottom: 0;
	}

	.note {
		font-size: 0.75rem;
		opacity: 0.65;
	}

/*
	顶部 LOGO。
	覆盖模板原本的写法（原来是一个直径 5.5rem 的白边圆圈 + Font Awesome 钻石字形）。

	尺寸是怎么定的：
	  现在的 LOGO 是完整标志（红色 F 标 + "Formula 1" 文字），宽高比 ≈ 1.99:1。
	  矩形要放进圆形里，光看宽度不够 —— 矩形的对角线必须小于圆的直径，否则四个角会顶出圆外。
	  按 1.99:1 算：设宽为 W，则高为 W/1.99，对角线 = W·√(1+1/1.99²) ≈ 1.12·W。
	  要 1.12·W < 直径，即 W < 直径 × 0.89。
	  这里取 70%（留出余量），因此圆圈设为 132px：
	    · 132 × 0.70 ≈ 92px 宽的 LOGO，对角 ≈ 103px < 132px ✅
	    · 其中 "Formula 1" 文字高约 15px，仍然清晰可读
	  之前用 88px 圆圈时 LOGO 只有 50px 宽，文字仅 12px，糊到看不清 —— 所以把圆圈放大了。

	改回钻石图标：把 index.html 里 .logo 内的 <img> 和 <span> 删掉，
	换成 <span class="icon fa-gem"></span>，并把下面的尺寸改回 5.5rem 即可。
*/
	#header .logo {
		width: 8.25rem;      /* 132px，原模板是 5.5rem */
		height: 8.25rem;
		display: -moz-flex;
		display: -webkit-flex;
		display: -ms-flex;
		display: flex;
		-moz-align-items: center;
		-webkit-align-items: center;
		-ms-align-items: center;
		align-items: center;
		-moz-justify-content: center;
		-webkit-justify-content: center;
		-ms-justify-content: center;
		justify-content: center;
		overflow: hidden;
		line-height: 1;
	}

		#header .logo img {
			width: 70%;
			height: auto;
			display: block;
		}

		#header .logo .logo-fallback {
			display: none;
			color: #ffffff;
			font-weight: 600;
			font-size: 1.75rem;
			letter-spacing: 0.1rem;
		}

		/* 图片加载失败时才显示文字 */
		#header .logo.is-fallback img {
			display: none;
		}

		#header .logo.is-fallback .logo-fallback {
			display: block;
		}

	@media screen and (max-width: 736px) {

		/* 手机上圆圈收小一些，避免占掉太多首屏高度 */
		#header .logo {
			width: 6.5rem;   /* 104px */
			height: 6.5rem;
		}

		#header .logo .logo-fallback {
			font-size: 1.4rem;
		}

	}

/*
	赛历（赛历卡片用）。
	配色参照赛历图：红色 #e10600 作强调色，过站次降低透明度。
	注意：模板给几乎所有文字加了 letter-spacing，中文会显得很开，这里逐个收窄。
*/
	.cal-next {
		border-left: 3px solid #e10600;
		background-color: rgba(255, 255, 255, 0.06);
		border-radius: 4px;
		padding: 1.25rem 1.25rem 1rem 1.25rem;
		margin: 0 0 2rem 0;
	}

		.cal-next.is-race-week {
			background-color: rgba(225, 6, 0, 0.18);
			border-left-color: #ff2a1f;
		}

		.cal-next-label {
			font-size: 0.7rem;
			letter-spacing: 0.15rem;
			opacity: 0.75;
			margin-bottom: 0.5rem;
		}

		.cal-next h3 {
			letter-spacing: 0.08rem;
			margin: 0 0 0.6rem 0;
			font-size: 1.25rem;
		}

		.cal-next .cal-meta {
			letter-spacing: 0.05rem;
			font-size: 0.85rem;
			margin: 0 0 0.5rem 0;
			opacity: 0.85;
		}

		.cal-next .cal-when {
			letter-spacing: 0.05rem;
			font-size: 0.9rem;
			margin: 0;
		}

		.cal-days {
			display: inline-block;
			margin-left: 0.5rem;
			padding: 0.15rem 0.6rem;
			border-radius: 999px;
			background-color: #e10600;
			color: #ffffff;
			font-size: 0.75rem;
			letter-spacing: 0.05rem;
		}

	.cal-head {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: baseline;
		gap: 0.5rem;
		font-size: 0.9rem;
		letter-spacing: 0.08rem;
		margin: 0 0 1rem 0;
	}

		.cal-today-wrap {
			font-size: 0.75rem;
			opacity: 0.6;
			letter-spacing: 0.05rem;
		}

	/*
		赛季切换（2026 / 2027）。
		用 aria-pressed 表示选中态 —— 样式与可访问性状态同一个来源，
		不会出现"看着选中了但读屏软件不知道"的偏差。

		⚠️ main.css 给所有 button 设了 `color: #ffffff !important`
		   （模板有意为之，它自己的 .button.primary 也用 !important 覆盖）。
		   所以选中态要让文字变深，必须同样用 !important —— 否则就是白底白字。
	*/
	.cal-seasons {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.5rem;
		margin: 0 0 1.25rem 0;
	}

		.cal-season-btn {
			background: transparent;
			border: 1px solid rgba(255, 255, 255, 0.3);
			border-radius: 4px;
			font-family: inherit;
			font-size: 0.8rem;
			letter-spacing: 0.12rem;
			height: auto;
			line-height: 1;
			padding: 0.5rem 0.95rem;
			transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
		}

			.cal-season-btn:hover {
				background: rgba(255, 255, 255, 0.12);
			}

			.cal-season-btn[aria-pressed="true"] {
				background: #ffffff;
				border-color: #ffffff;
				color: #1b1f22 !important;
				font-weight: 600;
			}

		/* "今天是…"推到最右，与按钮同一行 */
		.cal-seasons .cal-today-wrap {
			margin-left: auto;
		}

	.cal-season[hidden] {
		display: none;
	}

	/* 2027 时段未公布时的提示行 */
	.cal-item .cal-sess .cal-s.is-pending {
		opacity: 0.5;
		font-style: italic;
		letter-spacing: 0.05rem;
	}

	.cal-note strong {
		font-weight: 600;
		opacity: 0.95;
	}

	.cal-list {
		list-style: none;
		padding-left: 0;
		margin: 0 0 1.5rem 0;
		/*
			24 站全列出来会比视口还高，卡片会被撑破。
			这里限制高度并让列表内部滚动，同时把滚动条做得不那么扎眼。
		*/
		max-height: 22rem;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
	}

		.cal-list::-webkit-scrollbar {
			width: 6px;
		}

		.cal-list::-webkit-scrollbar-track {
			background: transparent;
		}

		.cal-list::-webkit-scrollbar-thumb {
			background-color: rgba(255, 255, 255, 0.25);
			border-radius: 3px;
		}

			.cal-list::-webkit-scrollbar-thumb:hover {
				background-color: rgba(255, 255, 255, 0.4);
			}

		.cal-item {
			display: block;
			padding: 0.6rem 0.75rem;
			border-radius: 3px;
			font-size: 0.85rem;
			letter-spacing: 0.04rem;
		}

			.cal-item:nth-child(odd) {
				background-color: rgba(255, 255, 255, 0.05);
			}

			.cal-item.is-done {
				opacity: 0.45;
			}

			.cal-item.is-next {
				background-color: rgba(225, 6, 0, 0.22);
				opacity: 1;
			}

		/* 第一行：站次 + 分站 + 周末日期 */
		.cal-item .cal-row {
			display: flex;
			align-items: center;
			flex-wrap: wrap;
			gap: 0.5rem;
		}

			.cal-item.is-next .cal-row {
				font-weight: 600;
			}

			.cal-item .cal-round {
				flex: 0 0 4.2rem;
				opacity: 0.75;
				font-size: 0.78rem;
			}

			.cal-item .cal-place {
				flex: 1 1 auto;
			}

				.cal-item .cal-place em {
					font-style: normal;
					opacity: 0.6;
					font-size: 0.78rem;
				}

			.cal-item .cal-weekend {
				flex: 0 0 auto;
				color: #ff5a4d;
				font-weight: 600;
				font-size: 0.8rem;
			}

				.cal-item.is-done .cal-weekend {
					color: inherit;
					opacity: 0.8;
				}

		/* 第二行：各时段（北京时间） */
		.cal-sess {
			display: flex;
			flex-wrap: wrap;
			gap: 0.35rem 0.9rem;
			margin-top: 0.35rem;
			padding-left: 4.7rem;
			font-size: 0.75rem;
			letter-spacing: 0.02rem;
			opacity: 0.9;
		}

			.cal-sess .cal-s {
				white-space: nowrap;
			}

			/*
				时段分两行：第一行练习赛，第二行排位赛+正赛。
				每行独立 flex，行与行之间留一点间距。
			*/
			.cal-sess .cal-sess-row {
				display: flex;
				flex-wrap: wrap;
				gap: 0.35rem 0.9rem;
			}

				.cal-sess .cal-sess-row + .cal-sess-row {
					margin-top: 0.3rem;
				}

			/* 星期几：比时间更淡，只在当天第一项前面出现一次 */
			.cal-sess .cal-s .cal-wd {
				font-style: normal;
				display: inline-block;
				min-width: 1.7rem;
				margin-right: 0.15rem;
				color: #7ec8ff;
				opacity: 0.9;
				font-size: 0.68rem;
			}

				.cal-sess .cal-s .cal-wd:empty {
					display: none;
				}

			.cal-sess .cal-s.is-race .cal-wd {
				color: #ffb0a8;
			}

			/*
				窄屏压缩。
				加了星期后每项变宽，手机（≤640px）上第一行会从"FP1 FP2 FP3"
				折成两行 —— 而用户要的就是一行三个练习赛，所以这里收紧字号与间距。
				不用 display:none 躲折行，那样会丢信息。
			*/
			@media screen and (max-width: 640px) {
				.cal-sess {
					padding-left: 0;
					font-size: 0.68rem;
					gap: 0.28rem 0.55rem;
				}

				.cal-sess .cal-sess-row {
					gap: 0.28rem 0.55rem;
				}

				.cal-sess .cal-s i {
					min-width: 1.15rem;
					margin-right: 0.18rem;
					font-size: 0.6rem;
				}

				.cal-sess .cal-s .cal-wd {
					min-width: 1.35rem;
					margin-right: 0.1rem;
					font-size: 0.6rem;
				}
			}

			.cal-sess .cal-s i {
				font-style: normal;
				display: inline-block;
				min-width: 1.5rem;
				margin-right: 0.3rem;
				opacity: 0.65;
				font-size: 0.68rem;
			}

			.cal-sess .cal-s.is-race {
				color: #ff5a4d;
				font-weight: 600;
			}

			/* "最近一站"区块里的时段摘要 */
			.cal-sess-next {
				padding-left: 0;
				margin: 0.6rem 0 0 0;
				font-size: 0.82rem;
			}

				.cal-sess-next .cal-sess-item {
					white-space: nowrap;
				}

				.cal-sess-next .cal-sess-item b {
					font-weight: 600;
					display: inline-block;
					min-width: 3.2rem;
					opacity: 0.75;
					font-size: 0.75rem;
				}

				.cal-sess-next .cal-sess-item.is-race {
					color: #ff5a4d;
					font-weight: 600;
				}

			.cal-item .cal-flag {
				font-size: 0.68rem;
				letter-spacing: 0.05rem;
				opacity: 0.7;
			}

	.cal-note {
		font-size: 0.75rem;
		opacity: 0.6;
		letter-spacing: 0.04rem;
	}

	.cal-poster {
		margin-top: 1.5rem;
		border-top: 1px solid rgba(255, 255, 255, 0.2);
		padding-top: 1rem;
	}

		.cal-poster summary {
			cursor: pointer;
			font-size: 0.8rem;
			letter-spacing: 0.1rem;
			opacity: 0.8;
			outline: 0;
		}

			.cal-poster summary:hover {
				opacity: 1;
			}

		.cal-poster img {
			display: block;
			width: 100%;
			height: auto;
			margin-top: 1rem;
			border-radius: 4px;
		}

	@media screen and (max-width: 480px) {

		.cal-item .cal-round {
			flex: 0 0 3.6rem;
		}

		.cal-item .cal-place {
			flex: 1 1 auto;
			font-size: 0.82rem;
		}

		/* 手机上时段行不再缩进，改为占满整行，避免被挤到看不见 */
		.cal-sess {
			padding-left: 0;
			gap: 0.3rem 0.7rem;
		}

		.cal-sess-next .cal-sess-item b {
			min-width: 3rem;
		}

	}

/*
	【已解决】原注释记录的是"B站图标只能用别的图标顶替"以及两种替代方案
	（iconfont 字体 / 直接放 png）。现已采用**方案 2 的改良版**：
	自托管官方 logo SVG（可缩放、体积小、fill 用 currentColor 继承颜色），
	文件在 images/icons/，用法见 index.html 与 .brand-icons a img.brand-svg。

	本注释保留作为历史记录 —— 如果以后还想换图标，思路仍然是这两条。
*/
