/* slide.jason.tools —— 與 www.jason.tools 同一套品牌色與字型 */
:root {
	--navy: #114d6a; --navy-d: #0d3a51; --blue: #1b6f96; --orange: #b04f00; --orange-l: #f39200;
	--ink: #16242e; --text: #3a4a55; --muted: #66757f; --line: #e1e8ed; --line-d: #cdd8df; --soft: #f4f7f9;
	--shadow: 0 1px 2px rgba(15,37,51,.05), 0 2px 8px rgba(15,37,51,.05);
	--shadow-h: 0 4px 10px rgba(15,37,51,.08), 0 14px 30px rgba(15,37,51,.12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; color: var(--text); background: #fff; line-height: 1.7; -webkit-font-smoothing: antialiased; }
main { flex: 1; }
a { color: var(--blue); }
img { max-width: 100%; }
button, input, select { font: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* 頁首 */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.97); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15,37,51,.06); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 38px; width: auto; }
.brand span { font-weight: 700; color: var(--navy); font-size: 17px; padding-left: 12px; border-left: 1px solid var(--line-d); }
.top nav { display: flex; gap: 26px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; padding: 4px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.top nav a:hover { color: var(--navy); border-bottom-color: var(--orange-l); }

/* 首頁開場：文字 + 演講照片 */
.hero { background: linear-gradient(180deg, #f1f5f8 0%, #fff 100%); border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding-top: 52px; padding-bottom: 52px; }
.hero h1 { margin: 0 0 14px; font-size: clamp(32px, 4vw, 44px); line-height: 1.25; color: var(--ink); letter-spacing: .02em; }
.hero p { margin: 0 0 28px; font-size: 17px; line-height: 1.9; color: var(--text); }
.stats { display: flex; margin: 0; }
.stats div { padding: 0 28px; border-left: 1px solid var(--line-d); }
.stats div:first-child { padding-left: 0; border-left: 0; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats small { font-size: 14px; font-weight: 500; color: var(--muted); }
.hero-photo { margin: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 40px rgba(15,37,51,.18); aspect-ratio: 16 / 9; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 篩選列 */
.list { padding: 36px 0 80px; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; margin-bottom: 8px; }
.search, .select select { height: 48px; border: 1px solid var(--line-d); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.search:focus-within, .select select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(17,77,106,.14); outline: 0; }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 16px; color: var(--ink); background: transparent; }
.select { position: relative; display: block; }
.select select { width: 100%; -webkit-appearance: none; appearance: none; padding: 0 40px 0 16px; font-size: 15px; color: var(--ink); cursor: pointer; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.chips { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.chips { gap: 0 !important; }
.chip-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.chip-row:first-child { border-top: 0; padding-top: 4px; }
.chip-lb { padding-top: 7px; font-size: 13px; font-weight: 700; color: var(--navy); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row:not(.open) .chip.x { display: none; }
.chip-more { font-size: 14px; font-weight: 500; border: 1px dashed var(--line-d); background: transparent; color: var(--blue); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.chip-more:hover { border-color: var(--navy); color: var(--navy); }
.chip-row.open .chip-more { display: none; }
.chip { font-size: 14px; font-weight: 500; border: 1px solid var(--line-d); background: #fff; color: var(--ink); padding: 6px 15px; border-radius: 999px; cursor: pointer; text-decoration: none; transition: background-color .15s, color .15s, border-color .15s; }
.chip b { font-weight: 500; color: var(--muted); margin-left: 3px; }
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on b { color: rgba(255,255,255,.75); }
.chip.sm { font-size: 13px; padding: 2px 11px; }

/* 年份分組 + 卡片 */
.yh { display: flex; align-items: baseline; gap: 12px; margin: 44px 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 26px; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.yh small { font-size: 14px; font-weight: 500; color: var(--muted); }
.year[hidden] { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 24px; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s, border-color .2s; }
.card[hidden] { display: none; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); border-color: var(--line-d); }
.cover { position: relative; display: block; aspect-ratio: 16 / 9; background: #e9eef2; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .cover img { transform: scale(1.035); }
.pages { position: absolute; right: 8px; bottom: 8px; font-size: 12px; font-weight: 500; color: #fff; background: rgba(15,30,40,.72); padding: 1px 8px; border-radius: 4px; }
.card .body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 18px; }
.card .meta { display: flex; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.card .date { flex: none; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.card .ev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .name { font-weight: 700; font-size: 16.5px; line-height: 1.55; color: var(--ink); }
.card:hover .name { color: var(--navy); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* 簡報頁 */
.deck { padding-bottom: 80px; }
/* 簡報頁標題區：淡藍灰底，與白色頁首區隔 */
.deck-head { background: linear-gradient(180deg, #eaf1f6 0%, #f3f7fa 100%); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.crumb { font-size: 14px; color: var(--muted); padding-top: 22px; display: flex; gap: 8px; }
.crumb a { flex: none; color: var(--blue); text-decoration: none; }
.crumb .cur { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck h1 { font-size: clamp(24px, 3vw, 34px); color: var(--ink); line-height: 1.35; margin: 8px 0 8px; }
.deck-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.deck-meta .date { color: var(--navy); font-weight: 700; }
.deck-meta { margin-bottom: 10px; }
.deck-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.deck-tags .chip { background: #fff; }

.viewer { background: #1b1f24; outline: 0; }
.viewer .stage { position: relative; max-width: 1200px; margin: 0 auto; aspect-ratio: 16 / 9; max-height: calc(100vh - 170px); }
.viewer #slide { display: block; width: 100%; height: 100%; object-fit: contain; background: #111; user-select: none; }
.viewer .nav { z-index: 3; position: absolute; top: 0; bottom: 0; width: 18%; background: transparent; border: 0; cursor: pointer; opacity: 0; transition: opacity .2s; display: flex; align-items: center; color: #fff; }
.viewer .nav.prev { left: 0; justify-content: flex-start; padding-left: 12px; }
.viewer .nav.next { right: 0; justify-content: flex-end; padding-right: 12px; }
.viewer .stage:hover .nav { opacity: 1; }
.viewer .nav svg { width: 44px; height: 44px; padding: 8px; border-radius: 50%; background: rgba(0,0,0,.45); fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer .boot { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; background: #111; transition: opacity .3s; }
.viewer .boot.done { opacity: 0; pointer-events: none; }
.spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(143,169,191,.25); border-top-color: var(--orange-l); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer .bar { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 12px; color: #d8e0e6; }
.viewer .pager { display: flex; align-items: center; gap: 10px; }
.viewer .acts { display: flex; gap: 8px; justify-self: end; }
.viewer .bar button { width: 40px; height: 40px; border: 0; border-radius: 8px; background: #2a3138; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.viewer .bar button:hover { background: var(--navy); }
.viewer .bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.viewer .num { font-variant-numeric: tabular-nums; font-size: 15px; }
.viewer .num input { width: 60px; height: 36px; text-align: center; font-size: 15px; font-weight: 700; background: #111418; color: #fff; border: 1px solid #5d6a74; border-radius: 6px; padding: 0 4px; cursor: text; -moz-appearance: textfield; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); transition: border-color .15s, box-shadow .15s; }
.viewer .num input:hover { border-color: var(--orange-l); }
.viewer .num input:focus { outline: 0; border-color: var(--orange-l); box-shadow: inset 0 1px 3px rgba(0,0,0,.5), 0 0 0 3px rgba(243,146,0,.25); }
.viewer .num input::-webkit-inner-spin-button { -webkit-appearance: none; }
/* 佔滿視窗（不用瀏覽器全螢幕）：投影片 + 導覽列鋪滿瀏覽器可視範圍 */
.viewer .b-full .i-off, .viewer.fill .b-full .i-on { display: none; }
.viewer.fill .b-full .i-off { display: block; }
body.fill-on { overflow: hidden; }
.viewer.fill { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.viewer.fill .stage { flex: 1; min-height: 0; max-width: none; width: 100%; max-height: none; aspect-ratio: auto; }
.viewer.fill .bar { max-width: none; width: 100%; }
/* 總覽：直接蓋在投影片顯示區上 */
.grid-ov { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; overflow: auto; padding: 14px; background: #1b1f24; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-content: start; grid-auto-rows: max-content; }  /* 容器固定高度時，列高不可被壓縮（否則縮圖被裁成細條） */
.grid-ov[hidden] { display: none; }
.grid-ov figure { margin: 0; cursor: pointer; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: #26262b; transition: border-color .15s, transform .15s; }
.grid-ov figure:hover { border-color: var(--orange-l); transform: translateY(-2px); }
.grid-ov figure.cur { border-color: var(--orange-l); box-shadow: 0 0 0 3px rgba(242,139,11,.28); }
.grid-ov .th { position: relative; aspect-ratio: 16 / 9; background: #26262b; }
/* 舊版 iPad Safari 不支援 aspect-ratio：改用 inline-block + padding-top 撐出 16:9（grid 內用 % padding 會讓列高算錯而被裁切） */
@supports not (aspect-ratio: 1 / 1) {
	.grid-ov { display: block; }
	.grid-ov figure { display: inline-block; vertical-align: top; width: calc(25% - 10px); margin: 5px; }
	.grid-ov .th { padding-top: 56.25%; }
}
@supports not (aspect-ratio: 1 / 1) { @media (max-width: 640px) { .grid-ov figure { width: calc(33.333% - 10px); } } }
.grid-ov .th img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.grid-ov figcaption { font-size: 12px; text-align: center; color: #9aa7b0; padding: 2px; }
.viewer .fade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; transition: opacity .28s ease; z-index: 2; }
.fly { position: fixed; z-index: 50; pointer-events: none; border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,.6); transition: all .42s cubic-bezier(.2,.7,.2,1); }


/* 說明 + 逐頁文字 + 相關簡報 */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; margin-top: 40px; }
.about h2, .side h2 { font-size: 20px; color: var(--ink); margin: 0 0 14px; padding-left: 12px; border-left: 4px solid var(--navy); line-height: 1.3; }
.desc p { margin: 0 0 14px; font-size: 16px; line-height: 1.95; }
.tr-h { margin-top: 44px !important; }
.transcript { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.transcript li { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.transcript:not(.all) li:nth-child(n+5) { display: none; }
.tp { position: relative; display: block; width: 100%; align-self: start; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #e9eef2; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tp:hover { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(17,77,106,.12); }
.tp img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.tp span { position: absolute; left: 6px; top: 6px; min-width: 24px; padding: 0 6px; border-radius: 4px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.tx p { margin: 0 0 8px; font-size: 15px; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; }
.tx p:first-child { color: var(--ink); font-weight: 500; }
.tr-more { display: block; margin: 20px auto 0; padding: 10px 26px; border: 1px solid var(--navy); border-radius: 999px; background: #fff; color: var(--navy); font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.tr-more:hover { background: var(--navy); color: #fff; }
.side-list { display: flex; flex-direction: column; gap: 18px; }
.side .card .name { font-size: 15px; }

.foot { background: var(--soft); border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; padding: 22px 0; }
.foot p { margin: 0; }

@media (max-width: 900px) {
	.hero-in { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; padding-bottom: 36px; }
	.cols { grid-template-columns: 1fr; gap: 36px; }
	.side-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 440px) {
	.brand span { display: none; }
	.top nav { gap: 12px !important; }
}
@media (max-width: 640px) {
	.wrap { padding-left: 16px; padding-right: 16px; }
	.top .wrap { height: 58px; }
	.brand img { height: 30px; }
	.brand span { font-size: 15px; padding-left: 10px; }
	.top nav { gap: 14px; }
	.top nav a { font-size: 14px; }
	.hero p { font-size: 15.5px; }
	.stats div { padding: 0 16px; }
	.stats dd { font-size: 22px; }
	.filters { grid-template-columns: minmax(0, 1fr) 128px; }
	/* 手機：每組標籤一列，左右滑動，右側淡出提示還有更多 */
	.chip-row { grid-template-columns: 40px minmax(0, 1fr); padding: 6px 0; border-top: 0; margin-right: -16px; }
	.chip-lb { padding-top: 4px; }
	.chip-list { flex-wrap: nowrap; overflow-x: auto; padding: 2px 16px 2px 0; scrollbar-width: none; -webkit-overflow-scrolling: touch;
		-webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
	.chip-list::-webkit-scrollbar { display: none; }
	.chip-row .chip.x { display: inline-block !important; }  /* 手機可左右滑，全部顯示 */
	.chip-more { display: none; }
	.chip { flex: none; white-space: nowrap; font-size: 13px; padding: 4px 11px; }
	.deck h1 { font-size: 24px; }
	.deck-meta { font-size: 14px; gap: 2px 12px; }
	.deck-tags { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 2px 16px; scrollbar-width: none;
		-webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
	.deck-tags::-webkit-scrollbar { display: none; }
	.chip.sm { font-size: 12.5px; padding: 2px 10px; }
	.yh { margin-top: 32px; font-size: 22px; }
	.grid { grid-template-columns: 1fr; gap: 16px; }
	.viewer .nav { display: none; }
	.viewer .bar { gap: 6px; padding: 8px; }
	.grid-ov { grid-template-columns: repeat(3, 1fr); }
	.transcript li { grid-template-columns: 108px minmax(0, 1fr); gap: 14px; }
	.tx p { font-size: 14px; }
}

/* 播放區：停用手機「點兩下放大」（保留雙指縮放與捲動），連點上下頁不會觸發縮放 */
.viewer, .viewer * { touch-action: manipulation; }
.viewer .stage { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
