/**
 * 摸鱼小游戏 - 前台样式
 * 播放器弹窗：桌面 85vw×85vh max 1200px，移动端全屏
 */

.iomg-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px;
	box-sizing: border-box;
}

/* ===== 头部 ===== */
.iomg-header {
	text-align: center;
	margin-bottom: 18px;
}
.iomg-title {
	font-size: 30px;
	font-weight: 800;
	margin: 0 0 8px;
	line-height: 1.3;
}
.iomg-subtitle {
	margin: 0;
	font-size: 14px;
	color: #888;
	line-height: 1.6;
}

/* ===== 搜索 ===== */
.iomg-search {
	margin-bottom: 16px;
}
.iomg-search-input {
	width: 100%;
	max-width: 100%;
	padding: 10px 16px;
	border: 1px solid #e3e3e3;
	border-radius: 10px;
	font-size: 14px;
	background: #fff;
	color: #333;
	box-sizing: border-box;
	outline: none;
	transition: border-color .2s, box-shadow .2s;
}
.iomg-search-input:focus {
	border-color: var(--theme-color, #007aff);
	box-shadow: 0 0 0 3px rgba(0, 122, 255, .1);
}

/* ===== 主体：侧边栏 + 文字墙 ===== */
.iomg-body {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}
.iomg-sidebar {
	flex: 0 0 150px;
	background: #f7f7f9;
	border-radius: 12px;
	padding: 10px;
	position: sticky;
	top: 16px;
}
.iomg-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 13px;
	color: #444;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.iomg-cat:hover {
	background: #eee;
	color: #111;
}
.iomg-cat.active {
	background: var(--theme-color, #007aff);
	color: #fff;
	font-weight: 600;
}
.iomg-cat-num {
	font-size: 11px;
	opacity: .7;
}
.iomg-main {
	flex: 1;
	min-width: 0;
}

/* ===== 文字墙（游戏胶囊按钮，Grid 等宽对齐） ===== */
.iomg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
	gap: 10px;
}
.iomg-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 12px;
	border: 1px solid #e3e3e3;
	border-radius: 20px;
	background: #fff;
	color: #333;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
	transition: all .15s;
	user-select: none;
}
.iomg-item:hover {
	border-color: var(--theme-color, #007aff);
	color: var(--theme-color, #007aff);
	background: rgba(0, 122, 255, .04);
}
.iomg-item-icon {
	display: inline-flex;
	width: 15px;
	height: 15px;
	color: #999;
	flex-shrink: 0;
}
.iomg-item-icon svg {
	width: 100%;
	height: 100%;
}
.iomg-item:hover .iomg-item-icon {
	color: var(--theme-color, #007aff);
}
.iomg-empty {
	text-align: center;
	color: #999;
	padding: 30px 0;
	font-size: 14px;
}

/* ===== 最近游玩 ===== */
.iomg-recent {
	margin-bottom: 16px;
	padding: 12px 14px;
	background: #f7f7f9;
	border-radius: 12px;
}
.iomg-recent-title {
	font-size: 13px;
	font-weight: 600;
	color: #666;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.iomg-recent-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.iomg-recent-item {
	padding: 5px 12px;
	border-radius: 16px;
	background: #fff;
	border: 1px solid #e3e3e3;
	font-size: 12px;
	color: #333;
	cursor: pointer;
	transition: all .15s;
}
.iomg-recent-item:hover {
	border-color: var(--theme-color, #007aff);
	color: var(--theme-color, #007aff);
}

/* ===== 播放器弹窗 ===== */
.iomg-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100dvh;
	background: rgba(15, 23, 42, .95);
	backdrop-filter: blur(4px);
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity .3s;
}
.iomg-modal-overlay.active {
	display: flex;
	opacity: 1;
}
.iomg-modal-content {
	width: 85vw;               /* 桌面：视口宽 85% */
	height: 85vh;              /* 桌面：视口高 85% */
	max-width: 1200px;         /* 最大宽 */
	background: #000;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);
	transform: scale(.95);
	transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.iomg-modal-overlay.active .iomg-modal-content {
	transform: scale(1);
}
.iomg-modal-header {
	height: 44px;
	background: #1e293b;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 12px;
	border-bottom: 1px solid #334155;
	flex-shrink: 0;
}
.iomg-modal-title {
	font-size: 14px;
	color: #f8fafc;
	font-weight: 500;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1 1 0%;
}
.iomg-modal-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}
.iomg-modal-actions button {
	background: rgba(255, 255, 255, .1);
	color: #f8fafc;
	border: none;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: background .2s;
}
.iomg-modal-actions button:hover {
	background: rgba(255, 255, 255, .2);
}
.iomg-modal-actions .iomg-btn-close {
	background: rgba(239, 68, 68, .2);
	color: #fca5a5;
}
.iomg-modal-actions .iomg-btn-close:hover {
	background: rgba(239, 68, 68, .4);
	color: #fff;
}
.iomg-modal-body {
	flex: 1 1 0%;
	position: relative;
	width: 100%;
	height: calc(100% - 44px);
	background: #000;
	overflow: hidden;
}
.iomg-modal-body iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
	background: #000;
}

/* ===== 移动端（≤768px 全屏） ===== */
@media (max-width: 768px) {
	.iomg-body {
		flex-direction: column;
	}
	.iomg-sidebar {
		flex: none;
		width: 100%;
		position: static;
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
	}
	.iomg-cat {
		padding: 6px 10px;
	}
	.iomg-modal-content {
		width: 100%;
		height: 100%;
		border-radius: 0;
		transform: scale(1) translateY(100%);
		transition: transform .3s ease-out;
	}
	.iomg-modal-overlay.active .iomg-modal-content {
		transform: scale(1) translateY(0);
	}
	.iomg-modal-actions button span {
		display: none;
	}
	.iomg-modal-actions button {
		padding: 6px 12px;
		font-size: 16px;
	}
}

/* ===== 暗色适配 ===== */
.io-black-mode .iomg-item,
.io-black-mode .iomg-search-input,
.io-black-mode .iomg-recent-item {
	background: #1e1f20;
	border-color: #333;
	color: #ddd;
}
.io-black-mode .iomg-sidebar,
.io-black-mode .iomg-recent {
	background: #161719;
}
.io-black-mode .iomg-cat {
	color: #aaa;
}
.io-black-mode .iomg-cat:hover {
	background: #2a2b2c;
	color: #fff;
}
.io-black-mode .iomg-empty {
	color: #777;
}
.io-black-mode .iomg-subtitle {
	color: #777;
}
