/* ============================================================
 * 广告位小工具 — star-slider-widget
 * 轮播 / 平铺 / 折叠 三种模式 + 图片（日夜双图）/ HTML 双内容类型
 * 自适应 + 主题色 + 暗色模式兼容
 * ============================================================ */

/* ================= 通用：图片层与双图切换 ================= */
.io-star-img {
	position: absolute;
	inset: 0;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}
.io-star-img-dark { display: none; }
.io-black-mode .io-star-img-light { display: none; }
.io-black-mode .io-star-img-dark { display: block; }

/* 图片整卡链接覆盖层 */
.io-star-img-link,
.io-star-slide-link {
	position: absolute;
	inset: 0;
	z-index: 3;
}

/* 文字区（标题/副标题/按钮） */
.io-star-slide-title {
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	margin-bottom: 2px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.io-star-slide-sub {
	color: rgba(255, 255, 255, 0.85);
	font-size: 12px;
	line-height: 1.4;
	margin-bottom: 8px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.io-star-slide-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.io-star-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 7px 16px;
	border-radius: 20px;
	font-size: 13px;
	line-height: 1.4;
	text-decoration: none;
	background: var(--theme-color, #f1404b);
	color: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.io-star-btn:hover {
	opacity: 0.9;
	transform: translateY(-1px);
	color: #fff;
}
.io-star-slide-btns .io-star-btn + .io-star-btn {
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.65);
	color: #fff;
	box-shadow: none;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}
.io-star-slide-btns .io-star-btn-ad {
	border: 1px dashed rgba(255, 255, 255, 0.85);
}

/* ================= 模式一：轮播（淡入淡出） ================= */
.io-star-slider {
	position: relative;
	overflow: hidden;
	border-radius: 10px;
	background: #f2f3f5;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.io-star-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.8s ease;
	z-index: 1;
	overflow: hidden;
}
.io-star-slide.active {
	opacity: 1;
	z-index: 2;
}
.io-star-slide:not(.active) {
	pointer-events: none;
}
/* 图片文字区：底部渐变遮罩 + 对齐 */
.io-star-slide-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	padding: 30px 14px 14px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
	box-sizing: border-box;
}
/* HTML 幻灯片：居中展示，超出隐藏 */
.io-star-slide-html {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 10px;
	box-sizing: border-box;
}

/* 圆点 */
.io-star-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	z-index: 6;
	display: flex;
	justify-content: center;
	gap: 7px;
}
.io-star-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}
.io-star-dot.active {
	background: var(--theme-color, #f1404b);
	transform: scale(1.25);
}

/* 箭头 */
.io-star-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 6;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease, background 0.2s ease;
}
.io-star-prev { left: 8px; }
.io-star-next { right: 8px; }
.io-star-slider:hover .io-star-arrow { opacity: 1; }
.io-star-arrow:hover { background: var(--theme-color, #f1404b); }

/* ================= 模式二：平铺网格 ================= */
.io-star-grid {
	display: grid;
	grid-template-columns: repeat(var(--io-ss-cols, 2), 1fr);
	gap: 10px;
	align-items: start;
}
.io-star-cell {
	border-radius: 10px;
	overflow: hidden;
	background: #f2f3f5;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.io-star-cell-media {
	position: relative;
	overflow: hidden;
}
.io-star-cell-html {
	padding: 8px;
}
.io-star-cell .io-star-slide-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	padding: 26px 10px 10px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
	box-sizing: border-box;
}
.io-star-cell .io-star-slide-title { font-size: 13px; }
.io-star-cell .io-star-slide-btns { gap: 6px; }
.io-star-cell .io-star-btn { padding: 5px 11px; font-size: 12px; }

/* ================= 模式三：折叠盒 ================= */
.io-star-acc {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.io-star-acc-head {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 14px;
	background: #f7f8fa;
	border: none;
	border-bottom: 1px solid #eee;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: var(--theme-color, #f1404b);
	transition: background 0.2s ease;
}
.io-star-acc-head:hover { background: #f0f1f3; }
.io-star-acc-ico {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	margin-top: -3px;
	transition: transform 0.25s ease;
	flex-shrink: 0;
}
.io-star-acc.open .io-star-acc-ico { transform: rotate(225deg); margin-top: 3px; }
.io-star-acc-body { display: none; padding: 10px; }
.io-star-acc.open .io-star-acc-body { display: block; }
.io-star-acc-item + .io-star-acc-item {
	border-top: 1px solid #f0f1f3;
	padding-top: 10px;
	margin-top: 10px;
}
.io-star-acc-item-html { line-height: 1.5; }
.io-star-acc .io-star-slide-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	padding: 26px 10px 10px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
	box-sizing: border-box;
}

/* ================= 暗色模式 ================= */
.io-black-mode .io-star-slider,
.io-black-mode .io-star-cell {
	background: #2d2d2d;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.io-black-mode .io-star-acc {
	background: #222;
	border-color: #3a3a3a;
}
.io-black-mode .io-star-acc-head {
	background: #242424;
	border-bottom-color: #333;
	color: #e8e8e8;
}
.io-black-mode .io-star-acc-head:hover { background: #2a2a2a; }
.io-black-mode .io-star-acc-item + .io-star-acc-item { border-top-color: #333; }
.io-black-mode .io-star-slide-btns .io-star-btn + .io-star-btn {
	background: rgba(255, 255, 255, 0.12);
}

/* ================= 移动端适配 ================= */
@media (max-width: 575.98px) {
	.io-star-btn { padding: 6px 13px; font-size: 12px; }
	.io-star-slide-cap { padding: 26px 12px 12px; }
	.io-star-slide-title { font-size: 14px; }
	.io-star-arrow { width: 28px; height: 28px; font-size: 17px; opacity: 0.7; }
	.io-star-grid { gap: 8px; }
}
@media (max-width: 399.98px) {
	.io-star-grid { grid-template-columns: 1fr; }
}

/* ============================================================
 * 内置广告模板样式
 * 小工具后台「内置模板」一键插入的配套样式（仅随组件按需加载）。
 * ============================================================ */

/* ---- OpenCode Go（og-） ---- */
.og-ad {
	font-family: -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
	max-width: 100%;
	margin: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
	color: #1f2937;
	position: relative;
}
.og-ad::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(420px 180px at 90% -10%, rgba(99, 102, 241, 0.10), transparent 60%);
	pointer-events: none;
}
.og-ad * { box-sizing: border-box; }
.og-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px 0;
}
.og-brand {
	display: flex;
	align-items: center;
	gap: 9px;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0.2px;
	color: #111827;
}
.og-logo {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	color: #fff;
	flex-shrink: 0;
}
.og-badge {
	font-size: 11px;
	font-weight: 600;
	color: #b45309;
	background: rgba(251, 191, 36, 0.16);
	border: 1px solid rgba(251, 191, 36, 0.55);
	padding: 3px 9px;
	border-radius: 999px;
	white-space: nowrap;
}
.og-body { padding: 10px 16px 4px; }
.og-title {
	font-size: 15px;
	font-weight: 800;
	line-height: 1.35;
	margin: 0 0 3px;
	color: #111827;
}
.og-title .hl { color: #6366f1; }
.og-desc {
	font-size: 12px;
	line-height: 1.6;
	color: #6b7280;
	margin: 0 0 10px;
}
.og-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	margin-bottom: 10px;
}
.og-stat {
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 7px 4px;
	text-align: center;
}
.og-stat b {
	display: block;
	font-size: 14px;
	font-weight: 800;
	color: #111827;
	line-height: 1.2;
}
.og-stat span {
	font-size: 10px;
	color: #6b7280;
	line-height: 1.3;
	display: block;
	margin-top: 2px;
}
.og-list { margin: 0 0 10px; padding: 0; list-style: none; }
.og-list li {
	font-size: 11.5px;
	color: #374151;
	padding: 3px 0 3px 20px;
	position: relative;
	line-height: 1.5;
}
.og-list li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 5px;
	color: #10b981;
	font-weight: 700;
	font-size: 12px;
}
.og-perk {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0 16px 10px;
	padding: 7px 10px;
	border-radius: 10px;
	background: rgba(251, 191, 36, 0.12);
	border: 1px dashed rgba(217, 119, 6, 0.5);
	font-size: 11.5px;
	color: #92400e;
	line-height: 1.5;
	text-align: center;
}
.og-perk b { color: #b45309; font-weight: 700; }
.og-cta { display: block; text-align: center; padding: 0 16px 14px; }
.og-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 9px 14px;
	border-radius: 10px;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.15s, box-shadow 0.15s;
	box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}
.og-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
	color: #fff;
}
.og-btn small { font-weight: 400; opacity: 0.85; }
.io-black-mode .og-ad {
	background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
	border-color: transparent;
	box-shadow: 0 10px 30px rgba(79, 70, 229, 0.18);
	color: #e2e8f0;
}
.io-black-mode .og-ad::before {
	background: radial-gradient(420px 200px at 85% -10%, rgba(99, 102, 241, 0.35), transparent 60%);
}
.io-black-mode .og-brand { color: #f8fafc; }
.io-black-mode .og-title { color: #f8fafc; }
.io-black-mode .og-title .hl { color: #a5b4fc; }
.io-black-mode .og-desc { color: #94a3b8; }
.io-black-mode .og-stat {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
}
.io-black-mode .og-stat b { color: #f8fafc; }
.io-black-mode .og-stat span { color: #94a3b8; }
.io-black-mode .og-list li { color: #cbd5e1; }
.io-black-mode .og-badge {
	color: #fbbf24;
	background: rgba(251, 191, 36, 0.12);
	border-color: rgba(251, 191, 36, 0.35);
}
.io-black-mode .og-perk {
	background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(251, 146, 60, 0.10));
	border-color: rgba(251, 191, 36, 0.45);
	color: #fde68a;
}
.io-black-mode .og-perk b { color: #fbbf24; }
@media (max-width: 360px) {
	.og-stats { grid-template-columns: 1fr 1fr; }
}

/* ---- 阿里云 ECS（ali-promo-） ---- */
.ali-promo-card {
	position: relative;
	background: var(--main-bg-color, #fff);
	border-radius: var(--main-radius, 12px);
	padding: 18px 20px 20px;
	box-shadow: 0 2px 12px var(--muted-shadow, rgba(0, 0, 0, 0.06));
	transition: all 0.3s ease;
	border: 1px solid var(--muted-bg-color, rgba(0, 0, 0, 0.04));
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.ali-promo-card:hover {
	box-shadow: 0 8px 24px var(--main-shadow, rgba(0, 0, 0, 0.10));
	transform: translateY(-2px);
}
.ali-promo-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}
.ali-promo-logo { width: 24px; height: 24px; flex-shrink: 0; }
.ali-promo-brand {
	font-size: 14px;
	font-weight: 700;
	color: var(--main-color, #333);
	line-height: 1.2;
}
.ali-promo-badge {
	display: inline-block;
	background: var(--theme-color, #f1404b);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	padding: 1px 8px;
	border-radius: 10px;
	margin-left: auto;
	line-height: 18px;
	flex-shrink: 0;
}
.ali-promo-badge.green { background: #00a854; }
.ali-promo-slogan {
	font-size: 15px;
	font-weight: 700;
	color: var(--theme-color, #f1404b);
	margin-bottom: 10px;
	line-height: 1.4;
}
.ali-promo-slogan small {
	font-weight: 400;
	font-size: 12px;
	color: var(--muted-color, #999);
}
.ali-promo-config {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	margin-bottom: 12px;
	padding: 10px 12px;
	background: var(--theme-color-bg, rgba(var(--theme-color-rgb), 0.1));
	border-radius: calc(var(--main-radius, 12px) - 4px);
}
.ali-promo-config span {
	font-size: 12px;
	color: var(--muted-color2, #666);
	white-space: nowrap;
}
.ali-promo-config strong { color: var(--main-color, #222); font-weight: 700; }
.ali-promo-price-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.ali-promo-price {
	font-size: 24px;
	font-weight: 800;
	color: var(--theme-color, #f1404b);
	line-height: 1;
	letter-spacing: -0.5px;
}
.ali-promo-price-tag {
	font-size: 11px;
	background: var(--theme-color, #f1404b);
	color: #fff;
	padding: 1px 8px;
	border-radius: 4px;
	font-weight: 600;
	line-height: 20px;
}
.ali-promo-note { font-size: 11px; color: var(--muted-color, #999); }
.ali-promo-btn {
	display: block;
	width: 100%;
	padding: 10px 0;
	background: linear-gradient(135deg, var(--theme-color, #f1404b) 0%, #ff6a33 100%);
	color: #fff;
	text-align: center;
	border-radius: calc(var(--main-radius, 12px) - 4px);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.3s ease;
	letter-spacing: 0.5px;
}
.ali-promo-btn:hover {
	opacity: 0.92;
	box-shadow: 0 4px 16px rgba(var(--theme-color-rgb, 241, 64, 75), 0.35);
	color: #fff;
	text-decoration: none;
}
.ali-promo-btn:active { transform: scale(0.98); }
.ali-promo-extras {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	flex-wrap: wrap;
}
.ali-promo-extra {
	font-size: 11px;
	background: rgba(0, 168, 84, 0.1);
	color: #00a854;
	padding: 2px 8px;
	border-radius: 4px;
	font-weight: 500;
	line-height: 20px;
}
.ali-promo-extra.flash { background: rgba(255, 106, 0, 0.1); color: #ff6a00; }
.ali-promo-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10px;
	font-size: 11px;
	color: var(--muted-color, #bbb);
}
.ali-promo-footer a {
	color: var(--muted-color, #bbb);
	text-decoration: none;
	transition: color 0.2s;
}
.ali-promo-footer a:hover { color: var(--theme-color, #f1404b); }

/* ---- 腾讯云 EdgeOne（io-txad-） ---- */
.io-txad-wrap {
	position: relative;
	overflow: hidden;
	border-radius: var(--main-radius, 12px);
	background: linear-gradient(135deg, #e8f4ff 0%, #f0f8ff 100%);
	padding: 24px 20px 26px;
	transition: box-shadow 0.3s ease;
}
.io-black-mode .io-txad-wrap {
	background: linear-gradient(135deg, rgba(0, 82, 217, 0.12) 0%, rgba(0, 82, 217, 0.06) 100%);
}
.io-txad-wrap::before {
	content: "";
	position: absolute;
	top: -40px;
	right: -30px;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(0, 82, 217, 0.08) 0%, transparent 70%);
	pointer-events: none;
}
.io-txad-wrap::after {
	content: "";
	position: absolute;
	bottom: -20px;
	left: -20px;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(0, 82, 217, 0.05) 0%, transparent 70%);
	pointer-events: none;
}
.io-txad-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
	position: relative;
	z-index: 1;
}
.io-txad-logo {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 82, 217, 0.15);
}
.io-black-mode .io-txad-logo { background: rgba(255, 255, 255, 0.08); }
.io-txad-head h4 {
	font-size: 0.9375rem;
	font-weight: 700;
	margin: 0 0 2px;
	color: var(--main-color, #1a1a1a);
	line-height: 1.3;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.io-txad-badge {
	font-size: 0.625rem;
	font-weight: 600;
	background: #0052d9;
	color: #fff;
	padding: 1px 7px;
	border-radius: 8px;
	line-height: 1.6;
	white-space: nowrap;
}
.io-txad-sub { font-size: 0.75rem; color: var(--muted-color, #888); margin: 0; line-height: 1.4; }
.io-txad-list { list-style: none; padding: 0; margin: 0 0 18px; position: relative; z-index: 1; }
.io-txad-list li {
	font-size: 0.85rem;
	color: var(--main-color, #333);
	padding: 7px 0;
	display: flex;
	align-items: center;
	gap: 8px;
	line-height: 1.5;
}
.io-txad-list li svg { width: 14px; height: 14px; flex-shrink: 0; }
.io-txad-btn {
	display: block;
	text-align: center;
	padding: 13px 0;
	background: linear-gradient(135deg, #0052d9, #3a7bff);
	color: #fff !important;
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: 8px;
	text-decoration: none !important;
	transition: all 0.25s ease;
	box-shadow: 0 4px 12px rgba(0, 82, 217, 0.25);
	position: relative;
	z-index: 1;
}
.io-txad-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 82, 217, 0.35);
	color: #fff !important;
}
.io-txad-btn:active { transform: translateY(0); }
.io-txad-ft {
	text-align: center;
	font-size: 0.625rem;
	color: var(--muted-color, #aaa);
	margin-top: 14px;
	position: relative;
	z-index: 1;
}
