/* ============================================================
   中国索尼克线下活动情报 —— 公共样式
   标题条、蓝色渐变内容框、固定侧边按钮、黑色页脚沿用原版；
   页面背景改为纯色 #7b9ec9。
   ============================================================ */

/* 只支持浅色，屏蔽手机深色模式自动反色 */
html { color-scheme: only light; }

/* 始终预留滚动条位置：
   有的页面内容长、有滚动条，有的没有，会导致居中基准差 7px 左右，
   看起来像是「某一页整体偏右」。预留之后三页宽度一致。 */
html{
	scrollbar-gutter: stable;
	background-color: #7b9ec9;   /* 根元素也铺底色，避免跳转首帧白闪 */
}
@supports not (scrollbar-gutter: stable){
	html{ overflow-y: scroll; }
}

body{
	display: flex;
	flex-direction: column;
	background-color: #7b9ec9;              /* 图片加载前的兜底色 */
	background-image: url("pictures/bg-page.jpg");
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-attachment: fixed;           /* 滚动时背景不动 */
	margin: 0;
	padding: 0;
	min-height: 100vh;
}

/* 内容较少时让页脚留在视口底部；有内容时位置与原版一致 */
#event-list{ flex: 1 0 auto; }

.title{
	background-color: #e5e5e5;
	border: 1px solid gray;
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	padding: 0px 15px;
	margin: 0;
}
.title img{
	max-width: 100%;
	height:auto;
	display: block;
}
.main{
	padding: 20px 20px;
	background: linear-gradient(135deg, #c7d6e8, #7b9ec9);
	border: 4px solid #052881;
	width: 960px;                   /* 固定标准宽度 */
	max-width: calc(100% - 40px);   /* 窄屏自动收缩，两侧各留 20px */
	margin: 50px auto;
	flex: 1;
	position: relative;             /* 供右下角印记定位 */
}

/* 往期活动右下角的印记：绝对定位，不撑大卡片 */
.main .stamp{
	position: absolute;
	right: 6px;
	bottom: 6px;
	width: 150px;
	height: auto;
	opacity: .5;
	transform: rotate(-30deg);
	transform-origin: center;
	pointer-events: none;
	z-index: 3;
}
.main img{
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
}
.content-container {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 20px;
}
.content-container img {
	width: 40%;
	max-width: 100%;
	aspect-ratio: 16 / 9;   /* 统一成 16:9，多出的部分裁掉、不足的放大填满 */
	height: auto;
	object-fit: cover;
	object-position: center;
}
.text-content {
	flex: 1;
	text-align: left;
	color: #00103b;
}
.endpage{
	display: flex;
	flex-direction: column;
	background-color: black;
	color: white;
	padding: 20px 20px;
	margin: 0;
	justify-content: center;
	align-items: center;
	flex: 1;
}
/* 页脚里的编辑入口，单独一行、居中 */
/* 页脚里的邮箱链接：黑底上要看得清 */
.endpage a{
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.endpage a:hover{ color: #9fc0ff; }

.endpage .admin-link{
	margin: 8px 0 0;
	font-size: 13px;
	color: #9fc0ff;
	text-decoration: none;
	border-bottom: 1px dashed rgba(159, 192, 255, 0.55);
	padding-bottom: 1px;
	transition: color .18s, border-color .18s;
}
.endpage .admin-link:hover{
	color: #fff;
	border-bottom-color: #fff;
}
.side-buttons {
	position: fixed;      /* 固定定位，不随滚动移动 */
	left: 20px;           /* 距离左侧20px */
	/* 垂直居中；空间不足时整组下移，保证不压到页头 */
	top: max(50%, 330px);
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;  /* 竖向排列 */
	/* 偶尔窗口很矮时先压缩两个按钮的间距，按钮本身尺寸不变 */
	gap: clamp(16px, calc(100vh - 560px), 84px);
	z-index: 999;         /* 确保在最上层 */
}
.side-buttons a img {
	width: 80px;          /* 尺寸固定，不随窗口缩小 */
	height: auto;
	transition: transform 0.2s; /* 悬停动画 */
}

/* 正文里的链接沿用浏览器默认样式，只补充悬停反馈 */
.text-content a{ color: #052881; }
.text-content a:hover{ color: #e2001a; }

/* 活动分类标签：官方 / 同人 */
.cat{
	display: inline-block;
	padding: 0 12px;
	border-radius: 99px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.8;
	color: #fff;
	vertical-align: 1px;
}
.cat-official{ background: #052881; }
.cat-fan{ background: #b8451f; }

/* ===== 页头下方的筛选条：分类 + 年份 + 月份 ===== */
.head-filter{
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	box-sizing: border-box;
	width: fit-content;
	max-width: 90%;
	margin: 26px auto 0;
	padding: 10px 16px;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(5, 40, 129, 0.45);
	border-radius: 4px;
	font-size: 13px;
	color: #052881;
}
.hf-group{ display: flex; gap: 4px; }
.hf-search{ display: flex; align-items: center; }
.hf-search input{
	font: inherit;
	font-size: 13px;
	width: 210px;
	padding: 3px 12px;
	border: 2px solid #052881;
	border-radius: 99px;
	background: #fff;
	color: #052881;
	outline: none;
}
.hf-search input::placeholder{ color: #64789c; }
.hf-search input:focus{ box-shadow: 0 0 0 3px rgba(5, 40, 129, 0.15); }
.hf-chip{
	font: inherit;
	font-size: 13px;
	line-height: 1.5;
	padding: 3px 12px;
	border: 2px solid #052881;
	border-radius: 99px;
	background: #fff;
	color: #052881;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.hf-chip:hover{ background: #dbe6f5; }
.hf-chip[aria-pressed="true"]{ background: #052881; color: #fff; }
.hf-label{ display: flex; align-items: center; gap: 5px; font-size: 12px; }
.hf-select{
	font: inherit;
	font-size: 13px;
	padding: 3px 6px;
	border: 2px solid #052881;
	border-radius: 6px;
	background: #fff;
	color: #052881;
	cursor: pointer;
}
.hf-reset{
	font: inherit;
	font-size: 12px;
	padding: 2px 10px;
	border: 1px dashed #052881;
	border-radius: 6px;
	background: transparent;
	color: #052881;
	cursor: pointer;
}
.hf-reset:hover{ background: #fff; }
@media (max-width: 640px){
	.head-filter{ width: 92%; gap: 8px; padding: 9px 12px; }
	.hf-search{ width: 100%; }
	.hf-search input{ width: 100%; }
}

/* ===== 回到顶部按钮（右下角，下拉后出现） =====
   按钮外观由 pictures/arrow.png 自己提供，
   这里只负责定位、尺寸和显示/隐藏。 */
.to-top{
	position: fixed;
	right: 26px;
	bottom: 44px;
	z-index: 900;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s, bottom .15s ease;
}
.to-top.is-visible{
	opacity: 1;
	visibility: visible;
	transform: none;
}
.to-top img{
	width: 100%;
	height: 100%;
	display: block;
}
.to-top:hover{
	transform: translateY(-3px);
}
@media (max-width: 640px){
	.to-top{ right: 14px; bottom: 14px; width: 46px; height: 46px; }
}

/* 空状态：沿用同一套 .main 外观，不引入新的视觉元素 */
.main.is-empty .text-content{ color: #00103b; }

/* 放在最后，覆盖上面 .endpage 的 flex:1：在纵向 flex 布局里改为按内容高度，
   否则内容少的页面页脚会被拉成一整块黑色 */
body > .endpage{ flex: none; }

/* ============================================================
   响应式
   ------------------------------------------------------------
   左侧按钮始终保留，不隐藏。
   卡片和筛选栏都往右让出按钮占的宽度，四周留出呼吸边距。
   PC 宽屏（>1160px）：960px 居中，按钮 20+80px。
   平板（<=1160px）：按钮 80px，内容左让 120px。
   手机（<=720px）：按钮缩到 46px，內容左让 62px，图片上下排。
   ============================================================ */

@media (max-width: 1160px){
	.main{
		width: auto;
		max-width: none;
		margin: 36px 24px 36px 124px;
	}
	.head-filter{
		width: auto;
		max-width: none;
		margin: 24px 24px 0 124px;
	}
}

@media (max-width: 1000px){
	.main{
		margin: 28px 18px 28px 118px;
		padding: 16px;
	}
	.content-container{ gap: 16px; }
	.content-container h3{ font-size: 17px; }
	.content-container h4{ font-size: 14px; }
	.head-filter{
		margin: 20px 18px 0 118px;
	}
}

/* 手机：按钮改成横排，排在搜索栏正下方、与页头等距 */
@media (max-width: 720px){
	/* 页头放大：标题图原本是 HTML 上的 width=60%，窄屏下显得太小 */
	.title{
		padding: 0 8px;
		order: 1;
	}
	.title img{
		width: 90%;
	}

	/* 用 order 把按钮挪到筛选栏之后 */
	.head-filter{ order: 2; }

	.side-buttons{
		position: static;      /* 取消原来的左侧固定定位 */
		transform: none;
		left: auto;
		top: auto;
		order: 3;
		flex-direction: row;   /* 横向排列 */
		justify-content: center;
		align-items: center;
		gap: 10px;
		margin: 12px auto 0;
		padding: 0 10px;
	}
	.side-buttons a img{
		width: auto;
		height: 42px;          /* 横版按钮按高度控制 */
	}

	#event-list{ order: 4; }
	.endpage{ order: 5; }

	.main{
		margin: 12px 14px;
		padding: 12px;
		border-width: 3px;
	}
	.content-container{
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}
	.content-container img{ width: 100%; }
	.content-container h3{ font-size: 15.5px; }
	.content-container h4{ font-size: 13.5px; line-height: 1.65; }
	.content-container p{ margin: 6px 0; }
	.content-container .cat{ font-size: 12px; padding: 0 9px; }
	.main .stamp{ width: 92px; right: 2px; bottom: 2px; }

	.head-filter{
		width: auto;
		max-width: none;
		margin: 12px 14px 0;
		gap: 8px;
		padding: 10px 12px;
	}
	.hf-search{ flex: 1 1 100%; }
	.hf-search input{ width: 100%; }
}
/* ============================================================
   活动卡片逐个淡入
   ------------------------------------------------------------
   页头保持不动，只有卡片依次淡入；延迟由 js/app.js 设置。
   页面之间的跳转没有过渡，点链接立刻跳。
   ============================================================ */

/* 页头和筛选栏（含搜索框）始终不动，不参与任何过渡；
   侧边按钮和第一张卡片同时淡入，后面的卡片依次延迟（延迟由 js/app.js 设置） */
.main,
.side-buttons a{
	animation: cardIn .45s ease-out both;
}

@keyframes cardIn{
	from{ opacity: 0; transform: translateY(10px); }
	to{ opacity: 1; transform: none; }
}

/* 页脚等列表渲染完再淡入，避免它先出现在上方、再被推到底部的"闪动"；
   只用透明度，不带位移。body.is-ready 由 js/app.js 在渲染后加上。 */
.endpage{
	opacity: 0;
}

body.is-ready .endpage{
	opacity: 1;
	transition: opacity .45s ease-out;
}

@media (max-width: 720px){
	/* iOS 对 fixed 背景支持不好，会拉伸或卡顿，手机端改成随页面滚动 */
	body{ background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce){
	.main,
	.side-buttons a{ animation: none; }
	body.is-ready .endpage{ transition: none; }
}