:root {
	--bg: #0b1020;
	--card: #121a33;
	--muted: #8b97b3;
	--text: #e8ecf8;
	--primary: #6ea8fe;
	--accent: #b28dff;
	--danger: #ff6b6b;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
	box-sizing: border-box;
}

html, body {
	height: 100%;
}

body {
	margin: 0;
	background: radial-gradient(1200px 700px at 80% -10%, rgba(178, 141, 255, 0.15), transparent 55%),
	            radial-gradient(1200px 700px at 10% -10%, rgba(110, 168, 254, 0.18), transparent 50%),
	            var(--bg);
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

.app-header, .app-footer {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.brand h1 {
	font-size: 22px;
	font-weight: 700;
	margin: 0;
	letter-spacing: 0.2px;
}

.logo-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--primary), var(--accent));
	box-shadow: 0 0 18px rgba(110, 168, 254, 0.9);
}

.status {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	font-size: 14px;
}

.controls {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.controls select {
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.18);
	color: var(--text);
	padding: 6px 10px;
	border-radius: 10px;
	outline: none;
}

.toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	color: var(--muted);
	font-size: 14px;
}

.toggle input {
	display: none;
}

.toggle .slider {
	position: relative;
	width: 42px;
	height: 24px;
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 999px;
	transition: background 200ms ease;
}

.toggle .slider::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 3px;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: left 200ms ease, background 200ms ease;
}

.toggle input:checked + .slider {
	background: linear-gradient(135deg, var(--primary), var(--accent));
}

.toggle input:checked + .slider::after {
	left: 21px;
	background: #0f1530;
}

.spinner {
	width: 14px;
	height: 14px;
	border: 2px solid transparent;
	border-top-color: var(--primary);
	border-left-color: var(--primary);
	border-radius: 50%;
	animation: spin 900ms linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 20px 32px;
}

.news-grid {
	display: grid;
	grid-template-columns: 1fr; /* 每条新闻占据一整行 */
	gap: 18px;
}

.news-card {
	background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)) padding-box,
	            linear-gradient(135deg, rgba(110, 168, 254, 0.35), rgba(178, 141, 255, 0.35)) border-box;
	border: 1px solid transparent;
	border-radius: 14px;
	box-shadow: var(--shadow);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: relative;
	backdrop-filter: blur(6px);
	transform: translateY(6px);
	opacity: 0;
	animation: card-in 420ms cubic-bezier(.2,.7,.2,1) forwards;
}

.news-card:hover {
	transform: translateY(-2px);
	transition: transform 220ms ease-out;
}

@keyframes card-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 如果用户系统设置减少动画，则直接显示 */
@media (prefers-reduced-motion: reduce) {
	.news-card {
		opacity: 1 !important;
		transform: none !important;
		animation: none !important;
	}
}

.score-badge {
	position: absolute;
	right: 14px;
	bottom: 14px;
	height: 32px;
	padding: 0 12px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.18);
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	backdrop-filter: blur(6px);
}

.score-label {
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
}

.score-num {
	font-size: 18px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: 0.5px;
	background: linear-gradient(135deg, #c8d5ff, #ffffff);
	-webkit-background-clip: text;
	        background-clip: text;
	color: transparent;
}

.score-num.num-high {
	background: linear-gradient(135deg, #7ff0c8, #d6fff3);
	-webkit-background-clip: text;
	        background-clip: text;
	color: transparent;
}
.score-num.num-low {
	background: linear-gradient(135deg, #ff9aa8, #ffe1e5);
	-webkit-background-clip: text;
	        background-clip: text;
	color: transparent;
}
.score-num.num-mid {
	background: linear-gradient(135deg, #b3c5ff, #e9eeff);
	-webkit-background-clip: text;
	        background-clip: text;
	color: transparent;
}

.news-card.score-high {
	border-color: rgba(60, 212, 160, 0.55);
	box-shadow: var(--shadow), 0 0 0 1px rgba(60, 212, 160, 0.35);
}
.news-card.score-low {
	border-color: rgba(255, 107, 107, 0.6);
	box-shadow: var(--shadow), 0 0 0 1px rgba(255, 107, 107, 0.4);
}

/* 去掉呼吸动画，整体更克制协调 */

.news-title {
	font-size: 20px; /* 更大标题 */
	font-weight: 700;
	line-height: 1.35;
	margin: 0;
}

.news-content {
	color: #d5dbec;
	font-size: 16px; /* 正文更大 */
	line-height: 1.75;
	margin: 0;
}

.news-card.read {
	opacity: 0.75;
	filter: grayscale(12%);
}
.news-card.read .news-title {
	opacity: 0.85;
}

.news-related {
	margin: 2px 0 0;
	color: #e4e8f6;
	font-size: 15px;
	line-height: 1.6;
}

.news-related .tag {
	display: inline-block;
	margin-right: 6px;
	color: var(--muted);
}

.news-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	align-items: center;
	color: var(--muted);
	font-size: 14px; /* 元信息略大 */
}

.meta-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.06);
}

.meta-chip .dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--primary);
}

.meta-chip.source .dot {
	background: var(--accent);
}

.meta-chip.latency .dot {
	background: #3cd4a0;
}

.error-banner {
	margin: 8px 0 16px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid rgba(255, 107, 107, 0.35);
	background: rgba(255, 107, 107, 0.1);
	color: #ffdede;
	box-shadow: 0 6px 18px rgba(255, 107, 107, 0.15);
}

.hidden { display: none; }

@media (max-width: 640px) {
	.app-header, .app-footer {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
	.brand h1 { font-size: 18px; }
}

/* 通用按钮样式（用于“全部已读”） */
.btn {
	padding: 8px 14px;
	border-radius: 10px;
	border: 1px solid rgba(255,255,255,0.18);
	background: linear-gradient(135deg, rgba(110,168,254,0.25), rgba(178,141,255,0.25));
	color: var(--text);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0,0,0,0.25);
	transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.btn:hover {
	transform: translateY(-1px);
	background: linear-gradient(135deg, rgba(110,168,254,0.35), rgba(178,141,255,0.35));
	border-color: rgba(255,255,255,0.28);
}
.btn:active {
	transform: translateY(0);
}

/* 已读标记（默认隐藏，仅在已读状态展示） */
.read-badge {
	position: absolute;
	top: 10px;
	right: 12px;
	display: none;
	height: 22px;
	padding: 0 10px;
	border-radius: 999px;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	color: #0f1530;
	background: linear-gradient(135deg, #d6fff3, #7ff0c8);
	border: 1px solid rgba(60, 212, 160, 0.55);
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	z-index: 2;
	pointer-events: none; /* 不阻挡卡片点击切换已读 */
}
.read-badge .dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #3cd4a0;
}
.news-card.read .read-badge {
	display: inline-flex;
}

/* ==================== 心跳监控面板样式 ==================== */
.heartbeat-panel {
	margin-bottom: 24px;
	padding: 20px;
	background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)) padding-box,
	            linear-gradient(135deg, rgba(110, 168, 254, 0.25), rgba(178, 141, 255, 0.25)) border-box;
	border: 1px solid transparent;
	border-radius: 16px;
	box-shadow: var(--shadow);
	backdrop-filter: blur(6px);
}

.panel-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--text);
}

.pulse-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #3cd4a0;
	box-shadow: 0 0 8px rgba(60, 212, 160, 0.8);
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.6; transform: scale(0.9); }
}

.agent-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
}

.agent-card {
	padding: 14px 16px;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 12px;
	transition: transform 180ms ease, border-color 180ms ease;
}

.agent-card:hover {
	transform: translateY(-2px);
	border-color: rgba(255,255,255,0.2);
}

.agent-card.online {
	border-color: rgba(60, 212, 160, 0.45);
}

.agent-card.offline {
	border-color: rgba(255, 107, 107, 0.45);
}

.agent-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.status-indicator {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.status-indicator.online {
	background: #3cd4a0;
	box-shadow: 0 0 6px rgba(60, 212, 160, 0.7);
}

.status-indicator.offline {
	background: #ff6b6b;
	box-shadow: 0 0 6px rgba(255, 107, 107, 0.7);
}

.agent-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.agent-info {
	font-size: 12px;
	color: var(--muted);
	line-height: 1.5;
}

.agent-time {
	display: block;
	margin-top: 2px;
}

.agent-tips {
	display: block;
	margin-top: 4px;
	font-style: italic;
	color: #a8b4cc;
}

.status-text {
	font-weight: 500;
}

.status-text.online {
	color: #3cd4a0;
}

.status-text.offline {
	color: #ff6b6b;
}

@media (max-width: 640px) {
	.heartbeat-panel {
		padding: 14px;
	}
	.agent-grid {
		grid-template-columns: 1fr;
	}
}

