/* Insicore 前台樣式 — 設計 token + 共用元件 + 各樣板區塊 */

:root {
	--color-bg: #ffffff;
	--color-surface: #f6f7f9;
	--color-surface-2: #eef0f4;
	--color-text: #16181d;
	--color-muted: #646b78;
	--color-border: #e4e7ec;
	--color-accent: #4f46e5;
	--color-accent-hover: #4338ca;
	--color-accent-soft: #eef2ff;

	--radius: 16px;
	--radius-sm: 10px;
	--radius-pill: 999px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
	--shadow: 0 8px 30px rgba(16, 24, 40, .08);
	--shadow-lg: 0 20px 50px rgba(16, 24, 40, .12);

	--container: 1240px;
	--gap: 24px;

	--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.65;
	color: var(--color-text);
	background: var(--color-bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: 20px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	clip: rect(0 0 0 0); overflow: hidden;
}
.skip-link {
	position: absolute; left: -9999px; top: 0;
	background: var(--color-text); color: #fff;
	padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; z-index: 1000;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---- 頁首 / 頁尾 ---- */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(255, 255, 255, .82);
	backdrop-filter: saturate(160%) blur(12px);
	border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 20px; min-height: 64px;
}
.site-brand {
	font-size: 1.2rem; font-weight: 800; color: var(--color-text);
	letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 10px;
}
.site-brand:hover { color: var(--color-text); }
.site-brand img { max-height: 40px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
	display: inline-block; padding: 8px 14px; border-radius: var(--radius-pill);
	color: var(--color-muted); font-weight: 600; font-size: .95rem;
}
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--color-text); background: var(--color-surface); }

/* 行動版選單開關(由 main.js 注入;桌面與無 JS 時不顯示) */
.nav-toggle { display: none; }
@media (max-width: 768px) {
	.nav-toggle {
		display: inline-flex; align-items: center; justify-content: center;
		width: 44px; height: 44px; padding: 0;
		background: transparent; border: 1px solid var(--color-border);
		border-radius: var(--radius-sm); cursor: pointer; color: var(--color-text);
	}
	.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
		content: ""; display: block; width: 20px; height: 2px; background: currentColor;
		border-radius: 2px; transition: transform .2s ease, background .2s ease;
	}
	.nav-toggle__bar { position: relative; }
	.nav-toggle__bar::before { position: absolute; left: 0; top: -6px; }
	.nav-toggle__bar::after  { position: absolute; left: 0; top: 6px; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { top: 0; transform: rotate(45deg); }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { top: 0; transform: rotate(-45deg); }

	/* 只有 JS 接管(有漢堡鈕)時才把導覽收成下拉;否則維持原本可換行的清單 */
	.site-header__inner.has-nav-toggle { flex-wrap: wrap; }
	.has-nav-toggle .site-nav { flex-basis: 100%; order: 3; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 4px; }
	.has-nav-toggle .site-nav.site-nav--open { display: flex; }
	.has-nav-toggle .site-nav ul { flex-direction: column; gap: 2px; }
	.has-nav-toggle .site-nav a { display: block; padding: 12px 14px; border-radius: var(--radius-sm); }
}

.site-footer {
	margin-top: 80px; padding: 40px 0;
	border-top: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-muted); font-size: .92rem;
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer__nav a { color: var(--color-muted); }
.site-footer__nav a:hover { color: var(--color-text); }

/* ---- 版面 ---- */
.site-main { padding: 48px 0; }
.section { margin-top: 56px; }
.section:first-child { margin-top: 0; }
.section__title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section__title h2 { margin: 0; }
.lead { font-size: 1.15rem; color: var(--color-muted); }
.muted { color: var(--color-muted); }

/* ---- 按鈕 ---- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 20px; border-radius: var(--radius-pill);
	font-weight: 700; font-size: .98rem; line-height: 1;
	border: 1px solid transparent; cursor: pointer; transition: .15s ease;
	white-space: nowrap;
}
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-hover); color: #fff; }
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--ghost:hover { background: var(--color-surface); color: var(--color-text); }
.btn--store { background: var(--color-text); color: #fff; padding: 12px 22px; }
.btn--store:hover { background: #000; color: #fff; }
.btn--store small { display: block; font-size: .68rem; font-weight: 500; opacity: .75; }
.btn--store strong { display: block; font-size: 1rem; }
.btn--store__glyph { width: 22px; height: 22px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- badge / chip ---- */
.badge {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 12px; border-radius: var(--radius-pill);
	font-size: .82rem; font-weight: 700; line-height: 1.4;
	background: var(--color-surface-2); color: var(--color-text);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge--developing { background: #fff4e5; color: #b45309; }
.badge--soon { background: var(--color-accent-soft); color: var(--color-accent); }
.badge--released { background: #e7f7ee; color: #15803d; }
.badge--ended { background: #f1f2f4; color: #6b7280; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 12px; border-radius: var(--radius-pill);
	background: var(--color-surface); border: 1px solid var(--color-border);
	font-size: .85rem; font-weight: 600; color: var(--color-text);
}

/* ---- 圖片 / app icon ---- */
.app-icon {
	flex: none; width: 84px; height: 84px; border-radius: 20px;
	overflow: hidden; background: var(--color-surface);
	box-shadow: var(--shadow-sm); border: 1px solid var(--color-border);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon--lg { width: 112px; height: 112px; border-radius: 26px; }

/* ---- app 卡片 (archive / front-page 共用 template-parts/card-app.php) ---- */
.app-grid {
	display: grid; gap: var(--gap);
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.app-card {
	display: flex; flex-direction: column;
	background: var(--color-bg); border: 1px solid var(--color-border);
	border-radius: var(--radius); overflow: hidden;
	box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.app-card__media { aspect-ratio: 16 / 10; background: var(--color-surface); overflow: hidden; }
.app-card__media img { width: 100%; height: 100%; object-fit: cover; }
.app-card__media--empty { display: flex; align-items: center; justify-content: center; color: var(--color-muted); font-weight: 700; font-size: 2rem; }
.app-card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.app-card__head { display: flex; align-items: center; gap: 12px; }
.app-card__head .app-icon { width: 52px; height: 52px; border-radius: 13px; }
.app-card__title { margin: 0; font-size: 1.15rem; }
.app-card__title a { color: var(--color-text); }
.app-card__title a:hover { color: var(--color-accent); }
.app-card__tagline { margin: 0; color: var(--color-muted); font-size: .95rem; }
.app-card__excerpt { margin: 0; color: var(--color-muted); font-size: .92rem; }
.app-card__meta { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- 單一 app 頁 ---- */
.app-hero { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--color-surface); margin-bottom: 28px; }
.app-hero img { width: 100%; max-height: 420px; object-fit: cover; }
.app-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.app-head__main { flex: 1 1 320px; min-width: 0; }
.app-head__title { margin: 0 0 6px; }
.app-head__tagline { font-size: 1.2rem; color: var(--color-muted); margin: 0 0 16px; }
.app-head__badges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }

.screenshots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
.screenshots::-webkit-scrollbar { height: 8px; }
.screenshots::-webkit-scrollbar-track { background: transparent; margin: 0 4px; }
.screenshots::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 999px; }
.screenshots:hover::-webkit-scrollbar-thumb { background: var(--color-muted); }
.screenshots a { scroll-snap-align: start; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--color-border); background: var(--color-surface); }
.screenshots img { width: 100%; height: 100%; object-fit: cover; }

.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 0; padding: 22px; background: var(--color-surface); border-radius: var(--radius); }
.meta-list div { display: flex; flex-direction: column; gap: 2px; }
.meta-list dt { font-size: .8rem; color: var(--color-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.meta-list dd { margin: 0; font-weight: 700; }

/* ---- 內文 / prose ---- */
.prose { font-size: 1.02rem; color: #2a2e36; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose a { text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.4em; }

/* ---- 關聯卡(隱私條款 ⇄ app) ---- */
.relation-card {
	display: flex; align-items: center; gap: 16px;
	padding: 18px 20px; border: 1px solid var(--color-border);
	border-radius: var(--radius); background: var(--color-bg); box-shadow: var(--shadow-sm);
}
.relation-card:hover { box-shadow: var(--shadow); }
.relation-card__label { font-size: .82rem; color: var(--color-muted); font-weight: 600; margin-bottom: 2px; }
.relation-card__title { font-weight: 700; color: var(--color-text); }
.relation-card .app-icon { width: 56px; height: 56px; border-radius: 14px; }

/* 繼續探索:內容頁底部導覽卡片 */
.explore { max-width: 760px; margin: 56px auto 0; padding-top: 40px; border-top: 1px solid var(--color-border); }
.explore__title { margin: 0 0 18px; font-size: 1rem; font-weight: 700; color: var(--color-muted); }
.explore-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---- 外掛:定價方案 ---- */
.pricing-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.plan {
	position: relative; display: flex; flex-direction: column;
	padding: 28px 24px; background: var(--color-bg);
	border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.plan--featured { border-color: var(--color-accent); box-shadow: var(--shadow); }
.plan__tag {
	position: absolute; top: -12px; left: 24px; padding: 4px 12px;
	border-radius: var(--radius-pill); background: var(--color-accent); color: #fff;
	font-size: .78rem; font-weight: 700;
}
.plan__name { margin: 0 0 8px; font-size: 1.2rem; }
.plan__price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.plan__period { color: var(--color-muted); font-size: .9rem; margin-top: 4px; }
.plan__features { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plan__features li { position: relative; padding-left: 28px; font-size: .95rem; }
.plan__features li::before {
	content: ""; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%;
	background: var(--color-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.plan__cta { margin-top: 22px; }

/* ---- 外掛:變更日誌 ---- */
.changelog { display: flex; flex-direction: column; }
.changelog__item { padding: 20px 0; border-bottom: 1px solid var(--color-border); }
.changelog__item:first-child { padding-top: 0; }
.changelog__item:last-child { border-bottom: 0; }
.changelog__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.changelog__version { font-weight: 800; font-size: 1.05rem; color: var(--color-text); }
.changelog__date { color: var(--color-muted); font-size: .88rem; }
.changelog__list { margin: 0; padding-left: 1.3em; color: #2a2e36; display: flex; flex-direction: column; gap: 4px; }

/* ===== 首頁區塊 ===== */

/* 區塊外框 + 置中標題群 */
.home-section { padding: 88px 0; }
.home-section--alt { background: var(--color-surface); }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.eyebrow { display: inline-block; margin-bottom: 12px; color: var(--color-accent); font-weight: 700; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; }
.section-head h2 { margin: 0 0 14px; }
.section-head p { margin: 0; color: var(--color-muted); font-size: 1.1rem; }
.section-cta { margin-top: 44px; text-align: center; }

/* Hero */
.home-hero {
	position: relative; overflow: hidden; text-align: center; padding: 96px 0 88px;
	background: radial-gradient(80% 120% at 50% -10%, var(--color-accent-soft) 0%, rgba(238, 242, 255, 0) 60%), var(--color-bg);
}
.home-hero__eyebrow {
	display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 6px 16px;
	border-radius: var(--radius-pill); background: #fff; border: 1px solid var(--color-border);
	box-shadow: var(--shadow-sm); font-size: .85rem; font-weight: 600; color: var(--color-muted);
}
.home-hero__eyebrow strong { color: var(--color-accent); font-weight: 700; }
.home-hero__title { margin: 0 auto 18px; max-width: 16ch; font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.03em; }
.home-hero__subtitle { margin: 0 auto 32px; max-width: 600px; font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--color-muted); }
.home-hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn--lg { padding: 14px 28px; font-size: 1.05rem; }

/* 特色卡 */
.feature-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { padding: 30px 26px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.home-section--alt .feature { background: #fff; }
.feature__icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 14px; background: var(--color-accent-soft); color: var(--color-accent); }
.feature__icon svg { width: 26px; height: 26px; }
.feature__title { margin: 0 0 8px; font-size: 1.15rem; }
.feature__text { margin: 0; color: var(--color-muted); }

/* 開發流程 */
.process { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.process__step { padding: 30px 26px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); }
.home-section--alt .process__step { background: #fff; }
.process__step::before { counter-increment: step; content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 50%; background: var(--color-accent); color: #fff; font-weight: 800; }
.process__title { margin: 0 0 8px; font-size: 1.15rem; }
.process__text { margin: 0; color: var(--color-muted); }

/* CTA 區塊(深色漸層) */
.cta-band { padding: 56px 40px; border-radius: var(--radius); text-align: center; color: #fff; background: linear-gradient(135deg, var(--color-accent) 0%, #7c3aed 100%); box-shadow: var(--shadow-lg); }
.cta-band h2 { margin: 0 0 12px; color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta-band p { margin: 0 auto 28px; max-width: 520px; color: rgba(255, 255, 255, .85); font-size: 1.1rem; }
.cta-band .btn--primary { background: #fff; color: var(--color-accent); }
.cta-band .btn--primary:hover { background: #f3f4f6; color: var(--color-accent); }

@media (max-width: 640px) {
	.home-section { padding: 56px 0; }
	.home-hero { padding: 64px 0 56px; }
	.cta-band { padding: 40px 24px; }
}

/* ---- 文章 / 頁面通用 ---- */
.entry { max-width: 760px; margin-inline: auto; }
.entry__header { margin-bottom: 28px; }
.entry__title { margin: 0 0 8px; }
.entry__meta { color: var(--color-muted); font-size: .92rem; }
.entry__thumb { margin-bottom: 28px; border-radius: var(--radius); overflow: hidden; }

.post-list { display: grid; gap: 24px; max-width: 760px; margin-inline: auto; }
.post-list__item { padding-bottom: 24px; border-bottom: 1px solid var(--color-border); }
.post-list__item:last-child { border-bottom: 0; }
.post-list__title { margin: 0 0 6px; font-size: 1.35rem; }

.pagination { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 48px; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
	padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
	color: var(--color-text); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.pagination a.page-numbers:hover { background: var(--color-surface); }

.empty-state { text-align: center; padding: 80px 20px; color: var(--color-muted); }
.empty-state h2 { color: var(--color-text); }

/* ---- 搜尋表單 ---- */
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form .search-field {
	flex: 1; padding: 11px 16px; border-radius: var(--radius-pill);
	border: 1px solid var(--color-border); font: inherit; background: var(--color-bg);
}
.search-form .search-field:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }

/* ---- 404 ---- */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 .code { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; color: var(--color-accent-soft); line-height: 1; }
.error-404 .btn { margin-top: 8px; }
.error-404 .search-form { margin: 28px auto 0; }

/* 網格後緊接的單一動作按鈕(首頁「查看全部」等)留白 */
.app-grid + .btn, .app-grid + a.btn { margin-top: 28px; }

/* ---- RWD ---- */
@media (max-width: 640px) {
	.site-main { padding: 32px 0; }
	.app-icon { width: 68px; height: 68px; border-radius: 16px; }
	.btn--store { flex: 1; }
	.btn-row { width: 100%; }
}
