/* ==========================================================================
   Alvinist Suite — 區塊樣式（使用主題 tokens，附 fallback 以相容任意主題）
   ========================================================================== */

/* ---- 規格表 ---- */
.al-specs {
	border: 1px solid var(--al-border, #ddd);
	border-radius: 10px;
	overflow: hidden;
	background: var(--al-card, #fff);
	margin: 2em 0;
}
.al-specs__title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--al-accent-text, #6f7d00);
	padding: 14px 18px 12px;
	border-bottom: 1px solid var(--al-border, #ddd);
	background: var(--al-surface, #f5f5f5);
}
.al-specs .wp-block-table,
.al-specs figure.wp-block-table { margin: 0; }
.al-specs table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	border: 0;
}
.al-specs table td, .al-specs table th {
	border: 0;
	border-bottom: 1px solid var(--al-border, #ddd);
	padding: 11px 18px;
	line-height: 1.7;
}
.al-specs table tr:last-child td { border-bottom: 0; }
.al-specs table td:first-child {
	width: 32%;
	font-weight: 700;
	color: var(--al-muted, #666);
	font-size: 13px;
	letter-spacing: 0.03em;
	background: color-mix(in oklab, var(--al-surface, #f5f5f5) 55%, transparent);
	white-space: nowrap;
}
.al-specs table tr:nth-child(even) td:last-child {
	background: color-mix(in oklab, var(--al-surface, #f5f5f5) 30%, transparent);
}

/* ---- 評分卡 ---- */
.al-scorecard {
	border: 1px solid var(--al-border, #ddd);
	border-radius: 10px;
	background: var(--al-card, #fff);
	padding: 24px;
	margin: 2em 0;
	position: relative;
	overflow: hidden;
}
.al-scorecard::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 4px;
	background: var(--al-accent, #c6d600);
}
.al-scorecard__head {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 6px;
}
.al-scorecard__score {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 108px;
	height: 108px;
	border-radius: 50%;
	background: var(--al-text, #1a1a1a);
	color: var(--al-bg, #fff);
	flex-shrink: 0;
}
.al-scorecard__label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.2em;
	opacity: 0.7;
}
.al-scorecard__num {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 34px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--al-accent, #e8ff00);
}
.al-scorecard__max { font-size: 11px; opacity: 0.7; }
.al-scorecard__verdict {
	flex: 1;
	min-width: 200px;
	font-family: 'Noto Serif TC', serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.6;
	margin: 0;
}
.al-scorecard__cols { margin-top: 8px; gap: 24px; }
.al-scorecard h4 {
	font-family: 'Noto Sans TC', sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin: 0.75em 0 0.25em;
}
.al-scorecard__pros h4 { color: var(--al-cat-review, #0f9d4f); }
.al-scorecard__cons h4 { color: var(--al-cat-deal, #e05d00); }
.al-scorecard ul {
	margin: 0.25em 0 0;
	padding-left: 0;
	list-style: none;
	font-size: 14.5px;
	line-height: 1.9;
}
.al-scorecard ul li { padding-left: 1.4em; position: relative; }
.al-scorecard__pros ul li::before {
	content: "+";
	position: absolute;
	left: 0;
	font-weight: 900;
	color: var(--al-cat-review, #0f9d4f);
}
.al-scorecard__cons ul li::before {
	content: "−";
	position: absolute;
	left: 0;
	font-weight: 900;
	color: var(--al-cat-deal, #e05d00);
}

/* ---- YouTube 懶載入 facade ---- */
.al-yt { margin: 2em 0; }
.al-yt__frame {
	position: relative;
	aspect-ratio: 16/9;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	cursor: pointer;
}
.al-yt__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease, opacity 0.2s;
}
.al-yt__frame:hover .al-yt__thumb { transform: scale(1.02); opacity: 0.9; }
.al-yt__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 68px;
	height: 48px;
	background: transparent;
	border: 0;
	cursor: pointer;
	color: rgba(23, 23, 23, 0.85);
	transition: color 0.15s;
}
.al-yt__frame:hover .al-yt__play { color: #f00; }
.al-yt__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.al-yt__caption {
	font-size: 13px;
	color: var(--al-muted, #666);
	margin-top: 8px;
	text-align: center;
}

/* ---- YouTube 影片牆 ---- */
.al-ytg {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin: 1.5em 0;
}
.al-ytg__item { margin: 0; }
.al-ytg__item .al-yt__frame { border-radius: 8px; }
.al-ytg__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 10px;
	text-align: left;
}
.al-ytg__title {
	font-family: 'Noto Sans TC', sans-serif;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--al-text, #1a1a1a);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.al-ytg__date { font-size: 12px; color: var(--al-muted, #666); }
.al-ytg--empty { text-align: center; padding: 2em 0; }
.al-ytg__more { text-align: center; padding: 1.5rem 0 0.5rem; min-height: 24px; }
.al-ytg__moreLink {
	font-size: 14px;
	color: var(--al-muted, #666);
	text-decoration: none;
	border: 1px solid var(--al-border, #ddd);
	border-radius: 999px;
	padding: 8px 20px;
	display: inline-block;
	transition: color 0.15s, border-color 0.15s;
}
.al-ytg__moreLink:hover { color: var(--al-accent-text, #6f7d00); border-color: var(--al-accent, #c6d600); }
@media (max-width: 781px) {
	.al-ytg { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 480px) {
	.al-ytg { grid-template-columns: 1fr; }
}

/* ---- 相關文章 ---- */
.al-related { margin: 3em auto 0; border-top: 1px solid var(--al-border, #ddd); padding-top: 1.75em; }
.al-related__heading {
	font-family: 'Noto Sans TC', sans-serif;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--al-muted, #666);
	margin: 0 0 1em;
}
.al-related__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
.al-related__thumb {
	display: block;
	aspect-ratio: 16/10;
	border-radius: 6px;
	overflow: hidden;
	background: linear-gradient(135deg, var(--al-img-ph-a, #eee), var(--al-img-ph-c, #ddd));
	margin-bottom: 10px;
}
.al-related__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-related__title {
	font-family: 'Noto Sans TC', sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.55;
	margin: 6px 0;
}
.al-related__title a { color: var(--al-text, #1a1a1a); text-decoration: none; }
.al-related__title a:hover { color: var(--al-accent-text, #6f7d00); }

/* ---- 閱讀時間 ---- */
.al-reading-time { white-space: nowrap; }

/* ---- Banner 輪播 ---- */
.al-banners {
	position: relative;
	overflow: hidden;
	border-radius: 10px;
	margin-bottom: 2rem;
}
.al-banners__track {
	display: flex;
	transition: transform 0.45s ease;
}
.al-banners__slide {
	flex: 0 0 100%;
	display: block;
	position: relative;
	aspect-ratio: 3.2/1;
	background: linear-gradient(135deg, var(--al-img-ph-a, #eee), var(--al-img-ph-c, #ddd));
}
.al-banners__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* 深淺模式各自圖片：有深色圖時依主題切換 */
.al-banners__img--dark { display: none; }
html[data-theme="dark"] .has-dark .al-banners__img--dark { display: block; }
html[data-theme="dark"] .has-dark .al-banners__img--light { display: none; }
/* Banner 標題疊圖（可於每張 Banner 勾選開關） */
.al-banners__slide.has-caption::after {
	content: "";
	position: absolute;
	inset: 40% 0 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
	pointer-events: none;
}
.al-banners__caption {
	position: absolute;
	left: 28px;
	right: 28px;
	bottom: 22px;
	z-index: 2;
	color: #fff;
	font-family: 'Noto Serif TC', serif;
	font-size: clamp(17px, 2.6vw, 30px);
	font-weight: 900;
	line-height: 1.4;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
	pointer-events: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
@media (max-width: 781px) {
	.al-banners__caption { left: 16px; right: 16px; bottom: 14px; }
}

.al-banners__dots {
	position: absolute;
	right: 16px;
	bottom: 14px;
	display: flex;
	gap: 8px;
}
.al-banners__dot {
	width: 26px;
	height: 4px;
	border-radius: 2px;
	border: 0;
	padding: 0;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.45);
	transition: background 0.2s;
}
.al-banners__dot.is-active { background: var(--al-accent, #e8ff00); }
@media (max-width: 781px) {
	.al-banners__slide { aspect-ratio: 2/1; }
}

/* ---- 限時優惠：活動已結束標示 ---- */
.al-deal-ended {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
	border: 1px solid var(--al-border, #ddd);
	border-left: 4px solid var(--al-cat-deal, #e05d00);
	background: color-mix(in oklab, var(--al-cat-deal, #e05d00) 8%, var(--al-card, #fff));
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 1.6em;
	font-size: 14.5px;
}
.al-deal-ended strong { color: var(--al-cat-deal, #e05d00); white-space: nowrap; }
.al-deal-ended span { color: var(--al-muted, #666); }

/* ---- TTS「用聽的」 ---- */
.al-tts {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: 10px;
}
.al-tts__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--al-border, #ddd);
	background: var(--al-surface, #f5f5f5);
	color: var(--al-text, #1a1a1a);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
}
.al-tts__btn:hover { border-color: var(--al-accent, #c6d600); color: var(--al-accent-text, #6f7d00); }
.al-tts.is-active .al-tts__play { border-color: var(--al-accent, #c6d600); color: var(--al-accent-text, #6f7d00); }
.al-tts__stop { padding: 4px 9px; }
.al-tts__rate,
.al-tts__voice {
	border: 1px solid var(--al-border, #ddd);
	background: var(--al-surface, #f5f5f5);
	color: var(--al-muted, #666);
	border-radius: 999px;
	padding: 3px 6px;
	font-size: 12px;
	cursor: pointer;
}
.al-tts__voice { max-width: 130px; text-overflow: ellipsis; }

/* ---- 即時搜尋下拉 ---- */
.al-livesearch {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: min(360px, 92vw);
	max-height: 70vh;
	overflow: auto;
	background: var(--al-card, #fff);
	border: 1px solid var(--al-border, #ddd);
	border-radius: 12px;
	box-shadow: var(--al-shadow, 0 12px 32px rgba(0, 0, 0, 0.12));
	z-index: 60;
}
.al-livesearch__item {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px 14px;
	text-decoration: none;
	border-bottom: 1px solid var(--al-border, #eee);
}
.al-livesearch__item:last-child { border-bottom: 0; }
.al-livesearch__item:hover { background: var(--al-surface, #f5f5f5); }
.al-livesearch__item img, .al-livesearch__ph {
	width: 52px;
	height: 52px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	background: linear-gradient(135deg, var(--al-img-ph-a, #eee), var(--al-img-ph-c, #ddd));
	display: block;
}
.al-livesearch__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.al-livesearch__text em {
	font-style: normal;
	font-size: 11px;
	font-weight: 700;
	color: var(--al-accent-text, #6f7d00);
}
/* 搜尋結果分類分色（同站內分類色系） */
.al-livesearch__text em.al-cat--review { color: var(--al-cat-review, #0f9d4f); }
.al-livesearch__text em.al-cat--phone { color: var(--al-cat-phone, #7040e0); }
.al-livesearch__text em.al-cat--news { color: var(--al-cat-news, #1e6fd9); }
.al-livesearch__text em.al-cat--deal { color: var(--al-cat-deal, #e05d00); }
.al-livesearch__text em.al-cat--deal::before { content: "🔥 "; }
.al-livesearch__text em.al-cat--ai { color: var(--al-cat-ai, #c0129e); }
.al-livesearch__text strong {
	font-size: 14px;
	font-weight: 700;
	color: var(--al-text, #1a1a1a);
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.al-livesearch__text small { font-size: 11px; color: var(--al-muted, #666); }
.al-livesearch__empty { padding: 16px; font-size: 13px; color: var(--al-muted, #666); }

/* ---- RWD ---- */
@media (max-width: 781px) {
	.al-related__grid { grid-template-columns: repeat(2, 1fr); }
	.al-scorecard { padding: 18px; }
	.al-scorecard__score { width: 92px; height: 92px; }
	.al-scorecard__num { font-size: 28px; }
	.al-scorecard__verdict { font-size: 17px; }
	.al-specs table td:first-child { width: 36%; }
}
@media (max-width: 480px) {
	.al-related__grid { grid-template-columns: 1fr; }
}
