* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow-x: hidden;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
	background: #f8f9fa !important;
	color: #2c3e50;
	line-height: 1.6;
	font-size: 14px;
}

#app {
	display: flex;
	min-height: 100vh;
	width: 100%;
}

/* 侧边栏 */
.sidebar {
	width: 260px;
	min-width: 260px;
	background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%) !important;
	color: white !important;
	padding: 20px 0;
	box-shadow: 2px 0 10px rgba(0,0,0,0.1);
	position: relative;
	z-index: 100;
	flex-shrink: 0;
}

.sidebar-header {
	padding: 0 20px 30px;
	border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-header h2 {
	font-size: 20px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
}

.sidebar-header h2 img {
	width: 24px;
	height: 24px;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

.sidebar-nav {
	padding: 20px 0;
}

.nav-item {
	display: flex;
	align-items: center;
	padding: 15px 20px;
	color: rgba(255,255,255,0.9);
	text-decoration: none;
	transition: all 0.3s;
	cursor: pointer;
}

.nav-item:hover {
	background: rgba(255,255,255,0.1);
	color: white;
}

.nav-item.active {
	background: rgba(255,255,255,0.2);
	color: white;
	border-left: 4px solid white;
}

.nav-item:link,
.nav-item:visited {
	text-decoration: none;
}

.nav-item:active {
	text-decoration: none;
}

.nav-icon {
	margin-right: 12px;
	font-size: 20px;
}

.nav-icon-img {
	width: 20px;
	height: 20px;
	margin-right: 12px;
	object-fit: contain;
	filter: brightness(0) invert(1);
	opacity: 0.9;
	transition: opacity 0.3s;
}

.nav-item:hover .nav-icon-img {
	opacity: 1;
}

/* 主内容区 */
.main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #f8f9fa;
	min-width: 0;
	overflow: hidden;
}

.topbar {
	background: white !important;
	padding: 18px 30px;
	border-bottom: 1px solid #e9ecef;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	position: sticky;
	top: 0;
	z-index: 10;
}

.page-title {
	font-size: 22px;
	font-weight: 600;
	color: #2c3e50;
	margin: 0;
}

.status-indicator {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: #f8f9fa;
	border-radius: 20px;
	font-size: 14px;
	border: 1px solid #e9ecef;
}

.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ccc;
}

.status-indicator:has(#live-status-text:contains('直播中')) .status-dot {
	background: #4caf50;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

.page-content {
	flex: 1;
	padding: 30px;
	overflow-y: auto;
}

.page {
	display: none;
}

.page.active {
	display: block;
}

/* 统计卡片 */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
	width: 100%;
}

.stat-card {
	background: white;
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
	border: 1px solid #e9ecef;
	display: flex !important;
	align-items: center;
	gap: 20px;
	transition: all 0.3s ease;
	flex-direction: row;
}

.stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
	border-color: #dee2e6;
}

.stat-icon {
	font-size: 40px;
	width: 60px;
	height: 60px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #667eea, #764ba2);
	border-radius: 12px;
	flex-shrink: 0;
}

.stat-icon img {
	width: 32px;
	height: 32px;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

.stat-info {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.stat-value {
	font-size: 28px;
	font-weight: 600;
	color: #2c3e50;
	line-height: 1.2;
	margin-bottom: 4px;
}

.stat-label {
	font-size: 13px;
	color: #6c757d;
	margin-top: 0;
	font-weight: 500;
}

/* 页面头部 */
.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 25px;
}

.page-header h2 {
	font-size: 24px;
	font-weight: 600;
}

/* 按钮 */
.btn {
	padding: 10px 20px;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s;
}

.btn-primary {
	background: #3498db;
	color: white;
	border: none;
}

.btn-primary:hover {
	background: #2980b9;
}

.btn-success {
	background: #27ae60;
	color: white;
	border: none;
}

.btn-success:hover {
	background: #229954;
}

.btn-secondary {
	background: #ecf0f1;
	color: #2c3e50;
	border: 1px solid #dee2e6;
}

.btn-secondary:hover {
	background: #d5dbdb;
	border-color: #cbd5db;
}

.btn-danger {
	background: #f44336;
	color: white;
}

.btn-danger:hover {
	background: #d32f2f;
}

.btn-sm {
	padding: 6px 12px;
	font-size: 12px;
}

/* 直播流卡片 */
.stream-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
	gap: 20px;
}

.stream-card {
	background: white;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stream-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.stream-card-header h3 {
	font-size: 18px;
	font-weight: 600;
}

.stream-status {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
}

.stream-status.enabled {
	color: #4caf50;
}

.stream-status.disabled {
	color: #999;
}

.stream-card-body {
	margin-bottom: 15px;
}

.stream-info {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	font-size: 14px;
}

.stream-info label {
	width: 80px;
	color: #666;
	font-weight: 500;
}

.stream-url {
	background: #f5f5f5;
	padding: 4px 8px;
	border-radius: 4px;
	font-family: monospace;
	font-size: 12px;
	max-width: 400px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.stream-type {
	background: #667eea;
	color: white;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
}

.stream-card-actions {
	display: flex;
	gap: 10px;
}

.empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #999;
	font-size: 16px;
}

/* 表单 */
.form-section {
	background: white;
	padding: 28px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
	border: 1px solid #e9ecef;
	max-width: 800px;
}

.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: #2c3e50;
	font-size: 14px;
}

.form-input,
.form-textarea,
.form-select {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
	outline: none;
	border-color: #3498db;
	box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-textarea {
	min-height: 100px;
	resize: vertical;
}

.switch {
	position: relative;
	display: inline-block;
	width: 50px;
	height: 24px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	transition: 0.3s;
	border-radius: 24px;
}

.slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.3s;
	border-radius: 50%;
}

input:checked + .slider {
	background-color: #3498db;
}

input:checked + .slider:before {
	transform: translateX(26px);
}

/* 表格 */
.table-container {
	background: white;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
	border: 1px solid #e9ecef;
	overflow: hidden;
}

/* Toast动画 */
@keyframes slideIn {
	from {
		transform: translateX(400px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes slideOut {
	from {
		transform: translateX(0);
		opacity: 1;
	}
	to {
		transform: translateX(400px);
		opacity: 0;
	}
}

/* Badge样式 */
.badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}

.badge-success {
	background: #e8f5e9;
	color: #2e7d32;
}

.badge-warning {
	background: #fff3e0;
	color: #f57c00;
}

.badge-info {
	background: #e3f2fd;
	color: #1976d2;
}

.badge-secondary {
	background: #f5f5f5;
	color: #666;
}

.badge-danger {
	background: #ffebee;
	color: #c62828;
}

/* 按钮尺寸 */
.btn-sm {
	padding: 6px 12px;
	font-size: 13px;
	margin-right: 5px;
}

.btn-danger {
	background: #f44336;
}

.btn-danger:hover {
	background: #d32f2f;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
}

.data-table th {
	background: #f8f9fa;
	padding: 14px 15px;
	text-align: left;
	font-weight: 600;
	font-size: 13px;
	color: #495057;
	border-bottom: 2px solid #dee2e6;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 12px;
}

.data-table td {
	padding: 14px 15px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
	color: #495057;
}

.data-table tr:hover {
	background: #f8f9fa;
}

.avatar-img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

.badge {
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}

.badge.active {
	background: #4caf50;
	color: white;
}

.badge.inactive {
	background: #999;
	color: white;
}

/* 搜索框 */
.search-box {
	margin-left: auto;
}

.search-input {
	padding: 8px 16px;
	border: 1px solid #ddd;
	border-radius: 20px;
	font-size: 14px;
	width: 250px;
}

/* 日期筛选 */
.date-filter {
	display: flex;
	align-items: center;
	gap: 10px;
}

.date-input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
}

/* 弹窗 */
.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	backdrop-filter: blur(4px);
}

.modal.show {
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-content {
	background: white;
	border-radius: 8px;
	width: 90%;
	max-width: 600px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0,0,0,0.15);
	border: 1px solid #e9ecef;
}

.modal-header {
	padding: 18px 25px;
	border-bottom: 1px solid #e9ecef;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #f8f9fa;
}

.modal-header h3 {
	font-size: 18px;
	font-weight: 600;
	color: #2c3e50;
}

.modal-close {
	font-size: 28px;
	cursor: pointer;
	color: #999;
	line-height: 1;
}

.modal-close:hover {
	color: #333;
}

.modal-body {
	padding: 25px;
}

.modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 20px;
}

/* 通知 */
.notification {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 15px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 2000;
	opacity: 0;
	transform: translateX(400px);
	transition: all 0.3s;
}

.notification.show {
	opacity: 1;
	transform: translateX(0);
}

.notification.success {
	background: #4caf50;
	color: white;
}

.notification.error {
	background: #f44336;
	color: white;
}

.notification.info {
	background: #2196f3;
	color: white;
}

/* 图表区域 */
.chart-section,
.stats-cards {
	background: white !important;
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
	border: 1px solid #e9ecef;
	margin-top: 20px;
	width: 100%;
}

.chart-section h3,
.stat-card-large h3 {
	margin-bottom: 20px;
	font-size: 16px;
	font-weight: 600;
	color: #2c3e50;
}

.chart-section canvas {
	max-width: 100%;
	height: auto;
}

.stats-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	gap: 20px;
}

/* 确保所有链接无下划线 */
a, a:link, a:visited {
	text-decoration: none !important;
}

a:hover, a:active {
	text-decoration: none !important;
}

/* 确保输入框样式 */
input, textarea, select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	border: 1px solid #ddd;
	font-family: inherit;
}

/* Checkbox样式 - 恢复默认外观以便可点击 */
input[type="checkbox"] {
	-webkit-appearance: checkbox !important;
	-moz-appearance: checkbox !important;
	appearance: checkbox !important;
	width: 18px !important;
	height: 18px !important;
	cursor: pointer !important;
	pointer-events: auto !important;
	position: relative !important;
	z-index: 10 !important;
	margin: 0 !important;
	flex-shrink: 0 !important;
}

input[type="radio"] {
	-webkit-appearance: radio !important;
	-moz-appearance: radio !important;
	appearance: radio !important;
}

/* 响应式 */
@media (max-width: 768px) {
	.sidebar {
		width: 200px;
		min-width: 200px;
	}
	
	.stats-grid {
		grid-template-columns: 1fr !important;
	}
	
	.stream-list {
		grid-template-columns: 1fr !important;
	}
	
	.page-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
}

/* 票数管理样式 */
.vote-card {
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 8px;
	text-align: center;
	background: white;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vote-value {
	font-size: 32px;
	font-weight: bold;
	margin: 10px 0;
	color: #667eea;
}

.vote-percentage {
	margin-top: 10px;
	color: #666;
	font-size: 14px;
}

/* AI 内容管理样式 */
.ai-content-card {
	background: white;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 15px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ai-content-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #eee;
}

.ai-content-side {
	padding: 4px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: bold;
}

.side-left {
	background: #e3f2fd;
	color: #1976d2;
}

.side-right {
	background: #fff3e0;
	color: #f57c00;
}

.ai-content-time {
	font-size: 12px;
	color: #999;
}

.ai-content-body p {
	margin: 10px 0;
	line-height: 1.6;
	color: #333;
}

.ai-content-meta {
	display: flex;
	gap: 15px;
	margin-top: 10px;
	font-size: 12px;
	color: #666;
}

.ai-content-actions {
	display: flex;
	gap: 10px;
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}


/* ==================== 观看人数动画效果 ==================== */
.highlight {
	animation: highlightPulse 1s ease-in-out;
}

@keyframes highlightPulse {
	0% {
		background-color: transparent;
		transform: scale(1);
	}
	50% {
		background-color: #fff3cd;
		transform: scale(1.1);
	}
	100% {
		background-color: transparent;
		transform: scale(1);
	}
}

.stream-viewers {
	transition: all 0.3s ease;
}

.stream-viewers.highlight {
	color: #9C27B0 !important;
	font-weight: 800 !important;
}

#viewers-count,
#active-users {
	transition: all 0.3s ease;
	display: inline-block;
}

#viewers-count.highlight,
#active-users.highlight {
	color: #2196F3 !important;
	font-weight: 700 !important;
}
