/**
 * 订阅通知 · 对齐 AIGC 页视觉（仅 content）
 * 结构：深色 Hero 舞台 + 白底 sheet 控件轨 + 四列卡片
 */

.sub {
	--ink: #1f2937;
	--mute: #6b7280;
	--line: #e5e7eb;
	--soft: #f9fafb;
	--accent: #3b82f6;
	--accent-soft: #eff6ff;
	--coral: #f97316;
	--mint: #14b8a6;
	--ok: #10b981;
	color: var(--ink);
	margin: 0 0 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

@media (min-width: 640px) {
	.sub {
		margin-top: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.sub {
		gap: 1.1rem;
		margin-bottom: 2rem;
	}
}

.sub * {
	box-sizing: border-box;
}

.sub-sheet {
	position: relative;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 1rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
	overflow: hidden;
}

/* ===== Controls / Rail ===== */
.sub-controls {
	position: sticky;
	top: 0.5rem;
	z-index: 20;
	padding: 0.85rem;
	background: #fff;
	overflow: visible;
}

@media (min-width: 640px) {
	.sub-controls {
		padding: 1rem;
	}
}

.sub-rail {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.45rem;
	overflow-x: auto;
	overflow-y: visible;
	overscroll-behavior-x: contain;
	touch-action: pan-x pan-y;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.5rem), transparent);
	-webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.5rem), transparent);
	padding-bottom: 2px;
}

.sub-rail::-webkit-scrollbar {
	display: none;
}

.sub-tab {
	appearance: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.38rem;
	flex-shrink: 0;
	padding: 0.5rem 0.85rem;
	border-radius: 999px;
	border: 1px solid transparent;
	background: var(--soft);
	color: #4b5563;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	white-space: nowrap;
	scroll-snap-align: start;
	transition: 0.16s ease;
	-webkit-tap-highlight-color: transparent;
}

.sub-tab i {
	font-size: 0.7rem;
	color: var(--accent);
}

.sub-tab-count,
.sub-tab em {
	font-style: normal;
	min-width: 1.1rem;
	padding: 0.05rem 0.32rem;
	border-radius: 999px;
	font-size: 0.65rem;
	font-weight: 700;
	background: #fff;
	color: #9ca3af;
	border: 1px solid var(--line);
}

.sub-tab:hover {
	color: var(--ink);
	border-color: #d1d5db;
	background: #fff;
}

.sub-tab.is-active {
	color: #fff;
	background: var(--accent);
	border-color: transparent;
	box-shadow: 0 6px 16px rgba(59, 130, 246, 0.28);
}

.sub-tab.is-active i,
.sub-tab.is-active .sub-tab-count,
.sub-tab.is-active em {
	color: #fff;
	background: rgba(255, 255, 255, 0.2);
	border-color: transparent;
}

/* ===== Sections ===== */
.sub-sec {
	padding: 1.1rem;
	min-width: 0;
}

@media (min-width: 640px) {
	.sub-sec {
		padding: 1.25rem;
	}
}

.sub-sec-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.95rem;
}

.sub-sec-title {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.sub-sec-ico {
	width: 2rem;
	height: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.65rem;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 0.75rem;
}

.sub-sec-meta {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.74rem;
	color: var(--mute);
}

.sub-panel.hidden,
.sub-panel[hidden] {
	display: none !important;
}

/* ===== Cards：一行 4 个 ===== */
.sub-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.75rem;
	width: 100%;
	min-width: 0;
}

@media (min-width: 640px) {
	.sub-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.85rem;
	}
}

@media (min-width: 900px) {
	.sub-cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.sub-cards {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.sub-card {
	--tone: var(--accent);
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 100%;
	padding: 0.95rem;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 0.9rem;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sub-card:hover {
	transform: translateY(-3px);
	background: #fff;
	border-color: #bfdbfe;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.sub-card.is-on {
	background: #fff;
	border-color: #6ee7b7;
	box-shadow: 0 10px 24px rgba(16, 185, 129, 0.08);
}

.sub-t0 { --tone: #3b82f6; }
.sub-t1 { --tone: #14b8a6; }
.sub-t2 { --tone: #f97316; }
.sub-t3 { --tone: #eab308; }
.sub-t4 { --tone: #8b5cf6; }
.sub-t5 { --tone: #10b981; }
.sub-t6 { --tone: #ec4899; }
.sub-t7 { --tone: #06b6d4; }

.sub-card-top {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
}

.sub-logo-fb {
	width: 2.85rem;
	height: 2.85rem;
	flex-shrink: 0;
	border-radius: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	font-weight: 800;
	color: #fff;
	background: var(--tone);
}

.sub-card.is-on .sub-logo-fb {
	background: linear-gradient(145deg, #10b981, #06b6d4);
}

.sub-card-body {
	min-width: 0;
	flex: 1;
}

.sub-card-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.4rem;
}

.sub-card h3 {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sub-card p {
	margin: 0.35rem 0 0;
	font-size: 0.78rem;
	line-height: 1.55;
	color: var(--mute);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.4rem;
}

.sub-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.45rem;
	margin-top: auto;
	padding-top: 0.75rem;
}

.sub-card-meta {
	min-width: 0;
	flex: 1;
	font-size: 0.72rem;
	color: #9ca3af;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sub-card-meta a {
	color: var(--accent);
	font-weight: 700;
	text-decoration: none;
}

.sub-card-meta a:hover {
	text-decoration: underline;
}

.sub-toggle-wrap {
	cursor: pointer;
	flex-shrink: 0;
}

.sub-toggle-ui {
	position: relative;
	display: block;
	width: 2.55rem;
	height: 1.4rem;
	border-radius: 999px;
	background: #d1d5db;
	transition: background 0.16s ease;
}

.sub-toggle-ui::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 1.15rem;
	height: 1.15rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
	transition: transform 0.16s ease;
}

.sub-toggle:checked + .sub-toggle-ui {
	background: var(--ok);
}

.sub-toggle:checked + .sub-toggle-ui::after {
	transform: translateX(1.15rem);
}

.sub-toggle:disabled + .sub-toggle-ui {
	opacity: 0.5;
}

.sub-toggle:focus-visible + .sub-toggle-ui {
	outline: 2px solid rgba(59, 130, 246, 0.4);
	outline-offset: 2px;
}

/* 空态 / 我的订阅 */
.sub-empty {
	padding: 2.5rem 1rem;
	text-align: center;
	color: var(--mute);
	font-size: 0.9rem;
}

.sub-empty i {
	display: block;
	margin-bottom: 0.55rem;
	font-size: 1.4rem;
	color: #cbd5e1;
}

.sub-mine-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.75rem;
}

@media (min-width: 768px) {
	.sub-mine-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.sub-mine-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.95rem;
	border-radius: 0.9rem;
	background: var(--soft);
	border: 1px solid var(--line);
}

.sub-mine-name {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 800;
}

.sub-mine-desc {
	margin: 0.25rem 0 0 !important;
	font-size: 0.78rem;
	color: var(--mute);
}

.sub-badge {
	flex-shrink: 0;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	font-size: 0.65rem;
	font-weight: 800;
	color: #047857;
	background: #d1fae5;
}

/* 最近通知：整行铺满 sheet，悬停背景通栏 */
.sub-feed-list {
	list-style: none;
	margin: 0 -1.1rem -1.1rem;
	padding: 0;
}

@media (min-width: 640px) {
	.sub-feed-list {
		margin: 0 -1.25rem -1.25rem;
	}
}

.sub-feed-item a {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.85rem;
	width: 100%;
	padding: 0.9rem 1.1rem;
	border-bottom: 1px solid #f3f4f6;
	text-decoration: none;
	color: inherit;
	transition: background 0.12s ease;
}

@media (min-width: 640px) {
	.sub-feed-item a {
		padding: 0.9rem 1.25rem;
	}
}

.sub-feed-item:last-child a {
	border-bottom: none;
}

.sub-feed-item a:hover {
	background: var(--soft);
}

.sub-feed-title {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 750;
	line-height: 1.4;
}

.sub-feed-summary {
	margin: 0.25rem 0 0;
	font-size: 0.78rem;
	line-height: 1.45;
	color: var(--mute);
}

.sub-feed-date {
	flex-shrink: 0;
	font-size: 0.74rem;
	color: #9ca3af;
	padding-top: 0.1rem;
}

.sub-footnote {
	margin: 0;
	text-align: center;
	font-size: 0.75rem;
	color: #9ca3af;
}

.sub-article {
	padding: 1.25rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 1rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	font-size: 0.875rem;
	line-height: 1.7;
	color: #4b5563;
}

/* ===== 未关注服务号：常驻引导 ===== */
.sub-follow-banner {
	display: grid;
	gap: 1.1rem;
	padding: 1.15rem;
	border-color: #bfdbfe;
	background:
		radial-gradient(120% 80% at 100% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
		linear-gradient(180deg, var(--accent-soft) 0%, #fff 55%);
}

@media (min-width: 768px) {
	.sub-follow-banner {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: 1.5rem;
		padding: 1.25rem 1.35rem;
	}
}

.sub-follow-banner-main {
	display: flex;
	gap: 0.85rem;
	align-items: flex-start;
	min-width: 0;
}

.sub-follow-banner-ico {
	flex-shrink: 0;
	width: 2.6rem;
	height: 2.6rem;
	display: grid;
	place-items: center;
	border-radius: 0.85rem;
	color: #07c160;
	background: #fff;
	border: 1px solid var(--line);
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
	font-size: 1.15rem;
}

.sub-follow-banner-copy h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--ink);
}

.sub-follow-banner-copy p {
	margin: 0.4rem 0 0;
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--mute);
}

.sub-follow-steps {
	margin: 0.7rem 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.sub-follow-steps li {
	position: relative;
	padding: 0.28rem 0.65rem 0.28rem 1.55rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	color: #059669;
	background: rgba(7, 193, 96, 0.1);
	border: 1px solid rgba(7, 193, 96, 0.22);
}

.sub-follow-steps li::before {
	counter-increment: none;
	content: attr(data-step);
}

.sub-follow-steps li:nth-child(1)::before,
.sub-follow-steps li:nth-child(2)::before,
.sub-follow-steps li:nth-child(3)::before {
	position: absolute;
	left: 0.35rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 0.62rem;
	font-weight: 800;
	color: #fff;
	background: #07c160;
}

.sub-follow-steps li:nth-child(1)::before { content: '1'; }
.sub-follow-steps li:nth-child(2)::before { content: '2'; }
.sub-follow-steps li:nth-child(3)::before { content: '3'; }

.sub-follow-banner-side {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.55rem;
}

.sub-follow-qr {
	width: 7.5rem;
	height: 7.5rem;
	object-fit: cover;
	border-radius: 0;
	border: 1px solid var(--line);
	background: #fff;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.sub-follow-check {
	appearance: none;
	border: none;
	cursor: pointer;
	font: inherit;
	font-weight: 800;
	width: 100%;
	min-width: 8.5rem;
	padding: 0.65rem 1rem;
	border-radius: 0.75rem;
	color: #fff;
	background: var(--accent);
	box-shadow: 0 8px 18px rgba(59, 130, 246, 0.28);
	transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.sub-follow-check:hover {
	background: #2563eb;
	transform: translateY(-1px);
}

.sub-follow-check:disabled {
	opacity: 0.65;
	cursor: wait;
	transform: none;
}

.sub-follow-banner.is-pulse {
	animation: subFollowPulse 1.1s ease;
}

@keyframes subFollowPulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
	35% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.28); }
}

