/*
Theme Name: jt-blog
Theme URI: https://blog.jason.tools/
Author: 節省工具箱 Jason Tools
Description: blog.jason.tools 自製佈景，依 2026-10-23 設計稿（A 首頁、D 文章內頁）製作；淺色／深色／跟隨系統三種配色。
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: jt-blog
Update URI: false
*/

/* ---------- 配色（design/docs/colors.json） ---------- */
:root {
	color-scheme: light;
	--bg: #F2F6FB; --surface: #FFFFFF; --surface2: #EAF2FF; --text: #102A49; --muted: #60738D;
	--line: #DCE6F2; --blue: #176BDE; --pill: #E4EFFF; --hero1: #FFFFFF; --hero2: #DEEDFF; --nav: #FFFFFF;
	--amber: #FFF6E7; --ambertext: #9A5C0F; --amberline: #F3D9AE; --code: #112740; --codebar: #243D5C;
	--btn: #176BDE; --btn-text: #FFFFFF; --badge: #176BDE; --badge-text: #FFFFFF;
	--author1: #0F2747; --author2: #173A66;
	--mark-bg: #176BDE; --mark-fg: #FFFFFF;
	--shadow: 0 1px 2px rgba(16, 42, 73, .04), 0 8px 24px rgba(16, 42, 73, .06);
	--img-line: #DCE6F2; --img-shadow: 0 6px 18px rgba(16, 42, 73, .08);
	--radius: 16px;
	--font: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0B1623; --surface: #142338; --surface2: #1A2E48; --text: #E8EFF9; --muted: #A5B7CD;
	--line: #2A405B; --blue: #85B8FF; --pill: #203E61; --hero1: #142538; --hero2: #193B64; --nav: #0E1B2C;
	--amber: #322B1D; --ambertext: #F0BB5C; --amberline: #5C4A26; --code: #0A1523; --codebar: #1A2A40;
	--btn: #85B8FF; --btn-text: #0B1623; --badge: #1E6FE0; --badge-text: #FFFFFF;
	--author1: #12243B; --author2: #1A3A62;
	--mark-bg: #88B9FF; --mark-fg: #10243D;
	--shadow: none;
	/* 深色：截圖改用深灰細框、拿掉陰影，不做反相 */
	--img-line: #2A405B; --img-shadow: none;
}
/* 沒有 JS 時退回跟隨系統 */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		color-scheme: dark;
		--bg: #0B1623; --surface: #142338; --surface2: #1A2E48; --text: #E8EFF9; --muted: #A5B7CD;
		--line: #2A405B; --blue: #85B8FF; --pill: #203E61; --hero1: #142538; --hero2: #193B64; --nav: #0E1B2C;
		--amber: #322B1D; --ambertext: #F0BB5C; --amberline: #5C4A26; --code: #0A1523; --codebar: #1A2A40;
		--btn: #85B8FF; --btn-text: #0B1623; --badge: #1E6FE0; --author1: #12243B; --author2: #1A3A62;
		--mark-bg: #88B9FF; --mark-fg: #10243D; --shadow: none; --img-line: #2A405B; --img-shadow: none;
	}
}

/* ---------- 基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.75; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.jt-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jt-skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--btn); color: var(--btn-text); padding: 10px 16px; border-radius: 8px; }
.jt-skip:focus { top: 12px; }
.jt-ico { flex: none; vertical-align: middle; }

.jt-wrap { width: 100%; max-width: 1536px; margin: 0 auto; padding: 0 32px; }
.jt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.jt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 32px; align-items: start; padding-top: 32px; padding-bottom: 64px; }
.jt-col { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.jt-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* ---------- 頁首 ---------- */
.jt-header { background: var(--nav); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.jt-header__in { min-height: 88px; display: flex; align-items: center; gap: 24px; }
.jt-brand { display: flex; align-items: baseline; gap: 28px; color: var(--text); margin-right: auto; white-space: nowrap; }
.jt-brand:hover { text-decoration: none; }
.jt-brand__zh { font-size: 32px; font-weight: 900; letter-spacing: .02em; }
.jt-brand__en { font-size: 27px; font-weight: 400; color: var(--muted); }
.jt-menu { display: none; }
.jt-menu > summary { display: inline-flex; }
.jt-menu > summary::-webkit-details-marker, .jt-search > summary::-webkit-details-marker { display: none; }
.jt-nav { display: flex; align-items: stretch; gap: 8px; }
.jt-nav a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 17px; font-weight: 500; padding: 30px 12px 27px; border-bottom: 3px solid transparent; white-space: nowrap; }
.jt-nav a:hover { color: var(--blue); text-decoration: none; }
.jt-nav a.is-on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.jt-tools { display: flex; align-items: center; gap: 12px; }
.jt-iconbtn { list-style: none; cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--muted); }
.jt-iconbtn:hover { background: var(--surface2); color: var(--text); }
.jt-search { position: relative; }
.jt-search[open] > summary { background: var(--surface2); color: var(--text); }
.jt-search__form { display: flex; gap: 8px; }
.jt-search > .jt-search__form { position: absolute; right: 0; top: 54px; width: min(420px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
.jt-search__form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.jt-search__form button, .jt-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--btn); color: var(--btn-text); font-weight: 700; cursor: pointer; }
.jt-btn:hover { text-decoration: none; filter: brightness(1.06); }
.jt-search__form--inline { max-width: 520px; margin: 16px 0; }
.jt-theme { display: flex; padding: 4px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.jt-theme button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 40px; min-height: 36px; padding: 0; white-space: nowrap; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.jt-theme button:hover { color: var(--text); }
.jt-theme button[aria-pressed="true"] { background: var(--pill); color: var(--blue); font-weight: 700; }

/* ---------- 共用小元件 ---------- */
.jt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; color: var(--muted); font-size: 15px; }
.jt-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 6px; background: var(--pill); color: var(--blue); font-size: 14px; font-weight: 500; line-height: 1.5; }
.jt-pill:hover { text-decoration: none; filter: brightness(.97); }
.jt-eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 14px; letter-spacing: .06em; }
.jt-card__h { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; font-size: 24px; font-weight: 900; color: var(--text); }
.jt-card__h .jt-ico { color: var(--blue); }

/* ---------- 主視覺 ---------- */
.jt-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 430px; background: linear-gradient(115deg, var(--hero1) 45%, var(--hero2)); }
.jt-hero__text { position: relative; z-index: 1; padding: 32px 32px 32px 32px; display: flex; flex-direction: column; gap: 20px; justify-content: center; }
.jt-hero__title { margin: 4px 0 0; font-size: 38px; line-height: 1.42; font-weight: 900; letter-spacing: .005em; }
.jt-hero__title a { color: var(--text); }
.jt-hero__ex { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.8; }
.jt-hero .jt-btn { align-self: flex-start; margin-top: 28px; }
.jt-hero__img { position: relative; display: block; margin: 0; }
.jt-hero__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0 var(--radius) var(--radius) 0; }
.jt-hero__img::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--hero1) 0, transparent 18%); pointer-events: none; }
.jt-hero--post { min-height: 350px; }
.jt-hero--post .jt-hero__title { font-size: 46px; line-height: 1.32; }
.jt-hero--post .jt-hero__text { justify-content: space-between; gap: 18px; }
.jt-hero--post .jt-pill { align-self: flex-start; }
.jt-hero__by { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 17px; }
.jt-sep { color: var(--line); }
.jt-hero__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.jt-hero--noimg { grid-template-columns: 1fr; min-height: 0; }

/* ---------- 最新文章清單 ---------- */
.jt-list { padding: 24px; }
.jt-list__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.jt-list__h { margin: 0; font-size: 30px; font-weight: 900; display: flex; align-items: center; gap: 14px; }
.jt-list__head > .jt-list__h::before { content: ""; width: 5px; height: 30px; border-radius: 3px; background: var(--blue); }
.jt-tabs { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.jt-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-size: 16px; }
.jt-tabs a:hover { color: var(--blue); text-decoration: none; background: var(--surface2); }
.jt-tabs a.is-on { color: var(--blue); font-weight: 700; }
.jt-row { position: relative; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 26px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.jt-row:last-of-type { border-bottom: 0; }
.jt-row__img { display: block; aspect-ratio: 330 / 180; border-radius: 12px; overflow: hidden; background: var(--surface2); }
.jt-row__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.jt-row:hover .jt-row__img img { transform: scale(1.03); }
.jt-row__noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.jt-row__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-right: 36px; }
.jt-row__title { margin: 0; font-size: 26px; line-height: 1.4; font-weight: 900; }
.jt-row__title a { color: var(--text); }
.jt-row__title a:hover { color: var(--blue); text-decoration: none; }
.jt-row__ex { margin: 4px 0 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.jt-row__go { position: absolute; right: 4px; bottom: 26px; color: var(--blue); }
.jt-empty { color: var(--muted); padding: 24px 0 0; }

.jt-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 24px; }
.jt-pager .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.jt-pager .page-numbers:hover { text-decoration: none; border-color: var(--blue); color: var(--blue); }
.jt-pager .current { background: var(--btn); border-color: var(--btn); color: var(--btn-text); font-weight: 700; }
.jt-pager .dots { border: 0; }

/* ---------- 側欄 ---------- */
.jt-side .jt-card { padding: 28px 24px; }
.jt-author { position: relative; overflow: hidden; color: #E8EFF9; background: linear-gradient(135deg, var(--author1) 60%, var(--author2)) !important; border-color: transparent !important; }
.jt-author::after { content: ""; position: absolute; right: 0; top: 0; width: 110px; height: 110px; background: linear-gradient(225deg, #2A6CC8 0 50%, transparent 50%); opacity: .5; }
.jt-author__eyebrow { margin: 0 0 16px; color: #A5B7CD; font-size: 16px; }
.jt-author__photo { display: block; width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.jt-authorbox__photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.jt-author__name { margin: 18px 0 4px; font-size: 30px; font-weight: 900; }
.jt-author__bio { margin: 0 0 22px; color: #D3DFEE; }
.jt-author__links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jt-author__links a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid #5E7EA6; border-radius: 8px; color: #E8EFF9; font-size: 16px; }
.jt-author__links a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.jt-author__links a.jt-author__about { grid-column: 1 / -1; background: #176BDE; border-color: #176BDE; color: #fff; font-weight: 700; }
.jt-author__links a.jt-author__about:hover { background: #1F78F0; }
.jt-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.jt-topic { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 18px; transition: border-color .15s, background .15s; }
.jt-topic:hover { text-decoration: none; }
.jt-topic small { color: var(--muted); font-weight: 400; font-size: 13px; margin-top: -6px; }
/* 每個主題一個色相（Jason：全藍太單調，2026/10/24）；卡片維持白底，只有圖示與淡色底塊、hover 邊框帶色 */
.jt-topic { --tc: var(--blue); }
.jt-topic:hover { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 6%, var(--surface)); }
.jt-topic .jt-ico { color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); padding: 7px; border-radius: 8px; box-sizing: content-box; }
:root[data-theme="dark"] .jt-topic .jt-ico { color: color-mix(in srgb, var(--tc) 65%, #fff); background: color-mix(in srgb, var(--tc) 24%, transparent); }
.jt-topic--cube { --tc: #E8710A; } .jt-topic--server { --tc: #176BDE; } .jt-topic--shield { --tc: #D6336C; }
.jt-topic--chart { --tc: #0F9F6E; } .jt-topic--gear { --tc: #5B6B85; } .jt-topic--network { --tc: #0E9AA7; }
.jt-topic--pulse { --tc: #7C5CFA; } .jt-topic--mail { --tc: #4C5FD5; } .jt-topic--inbox { --tc: #C98A04; }
.jt-topic--database { --tc: #0284C7; } .jt-topic--disk { --tc: #0D9488; } .jt-topic--archive { --tc: #65A30D; }
.jt-topic--log { --tc: #DB2777; } .jt-topic--funnel { --tc: #EA580C; } .jt-topic--terminal { --tc: #334155; }
.jt-topic--windows { --tc: #0EA5E9; } .jt-topic--laptop { --tc: #64748B; } .jt-topic--lang { --tc: #D97706; }
:root[data-theme="dark"] .jt-topic--terminal, :root[data-theme="dark"] .jt-topic--laptop, :root[data-theme="dark"] .jt-topic--gear { --tc: #94A3B8; }
/* 18 個主題：維持一行兩個（Jason 2026/10/24：兩欄比較好看，不要改） */
.jt-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.jt-topic { padding: 16px 18px; gap: 8px; font-size: 17px; word-break: keep-all; }
.jt-topic small { margin-top: -4px; }
/* 文章年份卡片：一年一張，三欄，與主題分類同樣白底細框 */
.jt-years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.jt-year { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, background .15s; }
.jt-year:hover { text-decoration: none; border-color: var(--blue); background: var(--surface2); }
.jt-year span { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.jt-year small { color: var(--muted); font-size: 13px; }
.jt-mini { list-style: none; margin: 0; padding: 0; }
.jt-mini li + li { border-top: 1px solid var(--line); }
.jt-mini a { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; padding: 12px 0; color: var(--text); }
.jt-mini a:hover { text-decoration: none; }
.jt-mini a:hover .jt-mini__t { color: var(--blue); }
.jt-mini__img { grid-row: span 2; width: 84px; height: 66px; border-radius: 8px; overflow: hidden; background: var(--surface2); }
.jt-mini__img img { width: 100%; height: 100%; object-fit: cover; }
.jt-mini__t { font-size: 16px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jt-mini time { align-self: end; color: var(--muted); font-size: 13px; }
.jt-toc__list { list-style: none; margin: 0; padding: 0; }
.jt-toc__list a { display: block; padding: 8px 14px 8px 20px; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.jt-toc__list a:hover { color: var(--text); text-decoration: none; }
.jt-toc__list a.is-on { color: var(--blue); background: var(--surface2); border-left-color: var(--blue); }
.jt-side--post { align-self: stretch; }   /* 側欄拉到跟文章一樣長，目錄才能一路跟到文章結束 */
.jt-toc--side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; }
.admin-bar .jt-toc--side { top: 56px; max-height: calc(100vh - 80px); }
.jt-toc--inline { display: none; }
.jt-authorbox { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 18px; }
.jt-authorbox__name { margin: 0; font-size: 22px; font-weight: 900; }
.jt-authorbox__bio { margin: 0; color: var(--muted); font-size: 14px; }
.jt-authorbox__go { grid-column: 1 / -1; justify-self: end; font-size: 15px; margin-top: -10px; }
.jt-links { list-style: none; margin: 0; padding: 0; }
.jt-links li + li { border-top: 1px solid var(--line); }
.jt-links a { display: block; padding: 14px 0; font-size: 18px; line-height: 1.5; }

/* ---------- 文章內頁 ---------- */
.jt-crumb { display: flex; gap: 6px; padding-top: 22px; color: var(--muted); font-size: 16px; }
.jt-crumb a { color: var(--muted); }
.jt-layout:has(.jt-article) { padding-top: 14px; }
.jt-article { gap: 0; }
.jt-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }

/* 文章本文：設計稿章節間距——前言到第一節 40px、之後每節 80px；一律用 CSS，不靠空白段落 */
.jt-entry { margin-top: 32px; font-size: 19px; line-height: 1.95; counter-reset: jt-sec; }
.jt-entry > * { margin-top: 0; margin-bottom: 20px; }
.jt-entry > :last-child { margin-bottom: 0; }
.jt-entry p { margin-top: 0; }
.jt-entry strong { font-weight: 700; color: var(--text); }
.jt-entry > h2.wp-block-heading { display: flex; align-items: center; gap: 20px; margin: 80px 0 22px; font-size: 34px; line-height: 1.35; font-weight: 900; }
.jt-entry > h2.wp-block-heading:first-of-type { margin-top: 40px; }
.jt-entry > h2.wp-block-heading:not(.jt-unnumbered)::before { counter-increment: jt-sec; content: counter(jt-sec, decimal-leading-zero); flex: none; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 8px; background: var(--badge); color: var(--badge-text); font-size: 29px; font-weight: 700; font-family: var(--font); }
.jt-entry > h3.wp-block-heading { margin: 44px 0 14px; font-size: 25px; line-height: 1.45; font-weight: 700; }
.jt-entry > h4.wp-block-heading { margin: 32px 0 10px; font-size: 21px; font-weight: 700; }
.jt-entry .wp-block-image { margin: 28px 0; text-align: center; }
.jt-entry .wp-block-image img { display: block; margin: 0 auto; border: 1px solid var(--img-line); border-radius: 12px; box-shadow: var(--img-shadow); background: var(--surface); }
.jt-entry .wp-block-image figcaption, .jt-entry .wp-element-caption { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.6; text-align: center; }
.jt-entry ul, .jt-entry ol { padding-left: 1.4em; }
.jt-entry li { margin: 6px 0; }
.jt-entry li > ul, .jt-entry li > ol { margin: 6px 0; }
.jt-entry a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent); text-underline-offset: 4px; word-break: break-word; }
.jt-entry a:hover { text-decoration-color: var(--blue); }
.jt-entry .wp-block-quote { margin: 28px 0; padding: 18px 24px; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; }
.jt-entry .wp-block-quote p { margin: 0; }
.jt-entry .is-style-jt-note { margin: 24px 0; padding: 16px 20px 16px 56px; position: relative; background: var(--amber); border: 1px solid var(--amberline); border-radius: 10px; color: var(--ambertext); font-weight: 500; }
.jt-entry .is-style-jt-note::before { content: "!"; position: absolute; left: 18px; top: 22px;   /* 對齊第一行中線：16px 內距＋(19px×1.95)/2−12px */ width: 24px; height: 24px; border-radius: 50%; background: #E9A21A; color: #fff; font-weight: 900; font-size: 15px; line-height: 24px; text-align: center; }
.jt-entry .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.jt-entry .wp-block-table { margin: 28px 0; overflow-x: auto; }
.jt-entry .wp-block-table table { width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.65; background: var(--surface); }
.jt-entry .wp-block-table th, .jt-entry .wp-block-table td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.jt-entry .wp-block-table th { background: var(--surface2); font-weight: 700; }
.jt-entry .wp-block-embed { margin: 28px 0; }
.jt-entry .wp-block-embed__wrapper { position: relative; aspect-ratio: 16 / 9; }
.jt-entry .wp-block-embed__wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; }
.jt-entry :not(pre) > code { font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--surface2); }

/* 程式碼區塊：上方語言標籤＋複製（app.js 加上），長指令水平捲動 */
.jt-code { margin: 24px 0; border-radius: 12px; overflow: hidden; background: var(--code); border: 1px solid var(--line); }
.jt-code__bar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 10px 0 22px; background: var(--codebar); color: #DCE6F2; font-size: 16px; }
.jt-code__copy { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #C8D6E8; font-size: 15px; cursor: pointer; }
.jt-code__copy:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.jt-entry pre.wp-block-code, .jt-code pre { margin: 0; padding: 20px 24px; background: var(--code); color: #E6EDF6; font-family: var(--mono); font-size: 15.5px; line-height: 1.75; white-space: pre; overflow-x: auto; tab-size: 4; border: 0; border-radius: 0; }
.jt-entry pre.wp-block-code { border-radius: 12px; }
.jt-code pre.wp-block-code { border-radius: 0; }
.jt-entry pre code { font-family: inherit; background: none; padding: 0; color: inherit; }
/* 語法上色（GitHub Dark 系，兩種模式共用深底） */
.hljs-comment, .hljs-quote { color: #8B9CB3; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-literal { color: #FF8F87; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #79C0FF; }
.hljs-string, .hljs-regexp, .hljs-addition { color: #A5D6FF; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #FFB86B; }
.hljs-variable, .hljs-template-variable, .hljs-attr, .hljs-attribute, .hljs-property { color: #D2A8FF; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #7EE787; }
.hljs-type, .hljs-params { color: #E6EDF6; }
.hljs-deletion { color: #FFA198; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* 延伸閱讀 */
.jt-more { margin-top: 64px; }
.jt-more__h { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font-size: 30px; font-weight: 900; }
.jt-more__h .jt-ico { color: var(--blue); }
.jt-more__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.jt-more__card { display: grid; grid-template-columns: 162px minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 20px; padding: 16px; color: var(--text); }
.jt-more__card:hover { text-decoration: none; border-color: var(--blue); }
.jt-more__img { grid-row: span 2; height: 110px; border-radius: 8px; overflow: hidden; background: var(--surface2); }
.jt-more__img img { width: 100%; height: 100%; object-fit: cover; }
.jt-more__t { font-size: 21px; font-weight: 900; line-height: 1.45; }
.jt-more__card time { color: var(--muted); font-size: 15px; }

/* 獨立頁面、404 */
.jt-page { padding-top: 32px; padding-bottom: 64px; }
.jt-page__card { max-width: 980px; margin: 0 auto; padding: 48px 56px; }
/* 獨立頁面：標題與內文同一張卡片；不編章節號、間距較緊（關於我是條列資料，不是長文） */
.jt-article .jt-page__card { max-width: none; margin: 0; padding: 44px 48px; }
.jt-entry--page { margin-top: 8px; }
.jt-entry--page > h2.wp-block-heading { margin-top: 48px; font-size: 28px; }
.jt-entry--page > h2.wp-block-heading:first-of-type { margin-top: 24px; }
.jt-entry--page > h2.wp-block-heading::before { content: none !important; }
.jt-entry--page > h2.wp-block-heading { padding-left: 14px; border-left: 5px solid var(--blue); }
.jt-page__title { margin: 0 0 24px; font-size: 40px; font-weight: 900; line-height: 1.35; }
.jt-page .jt-entry { margin-top: 0; }

/* ---------- 頁尾（Jason 2026/10/24：原本三行字太鬆散，改成深藍收尾帶，與關於作者卡同色系） ---------- */
.jt-footer { margin-top: 32px; background: linear-gradient(160deg, #0F2747 0%, #12305A 100%); color: #C6D3E4; }
:root[data-theme="dark"] .jt-footer { background: #08121E; border-top: 1px solid var(--line); }
.jt-footer a { color: #E6EDF6; }
.jt-footer a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.jt-footer__main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px 56px; padding-top: 56px; padding-bottom: 48px; }
.jt-footer__logo { display: inline-flex; align-items: center; gap: 14px; font-size: 22px; color: #FFFFFF !important; text-decoration: none !important; }
.jt-footer__logo b { font-weight: 900; margin-right: 4px; }
.jt-footer__logo span { color: #A9BBD2; }
.jt-footer__logo .jt-mark { --mark-bg: #176BDE; --mark-fg: #FFFFFF; }
.jt-footer__brand p { margin: 16px 0 22px; max-width: 30em; font-size: 15px; line-height: 1.8; }
.jt-footer__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.jt-footer__cta a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .28); font-size: 15px; font-weight: 500; }
.jt-footer__cta a:first-child { background: #176BDE; border-color: #176BDE; }
.jt-footer__cta a:hover { text-decoration: none; background: rgba(255, 255, 255, .1); }
.jt-footer__cta a:first-child:hover { background: #1F78F0; }
.jt-footer__col { display: flex; flex-direction: column; gap: 4px; }
.jt-footer__col h2 { margin: 6px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: #8EA3BE; }
.jt-footer__col a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; font-size: 16px; }
.jt-footer__col .jt-ico { opacity: .6; }
.jt-footer__bar { border-top: 1px solid rgba(255, 255, 255, .12); }
.jt-footer__bar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 18px; padding-bottom: 22px; }
.jt-footer__license { margin: 0; font-size: 13px; line-height: 1.8; color: #9FB1C8; }
.jt-footer__license a { color: #C6D3E4; text-decoration: underline; text-underline-offset: 3px; margin: 0 2px; }
.jt-footer__top { font-size: 14px; white-space: nowrap; color: #C6D3E4 !important; }
@media (max-width: 900px) {
	.jt-footer__main { grid-template-columns: 1fr 1fr; }
	.jt-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
	.jt-footer__main { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
}

/* ---------- 響應式 ---------- */
/* 頁首寬度不夠時依序收：拿掉英文副名 → 縮選單間距 → 漢堡選單（文字一律不換行）
   選單 5 項、配色只剩圖示後，實測約 1140px 才放不下副名、約 960px 才放不下選單 */
@media (max-width: 1180px) {
	.jt-brand__en { display: none; }
}
@media (max-width: 1280px) {
	.jt-layout { grid-template-columns: minmax(0, 1fr) 340px; }
	.jt-nav { gap: 2px; }
	.jt-nav a { padding-left: 8px; padding-right: 8px; font-size: 16px; }
}
@media (max-width: 960px) {
	.jt-header__in { flex-wrap: nowrap; gap: 6px; min-height: 64px; }
	.jt-tools { gap: 4px; }
	.jt-brand__zh { font-size: 26px; }
	.jt-nav--desk { display: none; }
	.jt-menu { display: block; order: 3; }
	.jt-menu[open] > .jt-nav { display: flex; flex-direction: column; gap: 0; position: absolute; left: 0; right: 0; top: 100%; padding: 8px 16px 16px; background: var(--nav); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, .1); }
	.jt-menu[open] > .jt-nav a { padding: 12px 8px; border-bottom: 1px solid var(--line); }
	.jt-menu[open] > .jt-nav a.is-on { border-bottom-color: var(--line); }
}
/* 內容版面：側欄移到內文之後；本文目錄改到內文前、可收合 */
@media (max-width: 1100px) {
	.jt-layout { grid-template-columns: minmax(0, 1fr); }
	.jt-toc--side { display: none; }
	.jt-toc--inline { display: block; margin-top: 24px; padding: 4px 20px; }
	.jt-toc--inline summary { display: flex; align-items: center; gap: 10px; min-height: 52px; font-weight: 900; font-size: 19px; cursor: pointer; }
	.jt-toc--inline summary .jt-ico { color: var(--blue); }
	.jt-toc--inline[open] { padding-bottom: 14px; }
}
@media (max-width: 760px) {
	/* 只改左右；用 padding 簡寫會把 .jt-layout 等的上下內距一起歸零，首篇圖會貼著頁首 */
	.jt-wrap { padding-left: 16px; padding-right: 16px; }
	.jt-layout { padding-top: 20px; padding-bottom: 48px; }
	body { font-size: 16px; }
	.jt-hero, .jt-hero--post { grid-template-columns: 1fr; min-height: 0; }
	.jt-hero__img { order: -1; aspect-ratio: 16 / 9; }
	.jt-hero__img img { border-radius: var(--radius) var(--radius) 0 0; }
	.jt-hero__img::before { background: linear-gradient(0deg, var(--hero1) 0, transparent 22%); }
	.jt-hero__text { padding: 20px; }
	.jt-hero__title { font-size: 27px; }
	.jt-hero--post .jt-hero__title { font-size: 30px; }
	.jt-hero .jt-btn { margin-top: 8px; }
	.jt-list { padding: 16px; }
	.jt-list__h { font-size: 24px; }
	.jt-row { grid-template-columns: 1fr; gap: 14px; }
	.jt-row__title { font-size: 21px; }
	.jt-row__body { padding-right: 0; }
	.jt-row__go { display: none; }
	.jt-entry { font-size: 17px; line-height: 1.9; }
	.jt-entry .is-style-jt-note::before { top: 20px; }
	.jt-entry > h2.wp-block-heading { margin-top: 56px; font-size: 25px; gap: 14px; }
	.jt-entry > h2.wp-block-heading:first-of-type { margin-top: 32px; }
	.jt-entry > h2.wp-block-heading:not(.jt-unnumbered)::before { width: 40px; height: 40px; font-size: 21px; }
	.jt-entry > h3.wp-block-heading { font-size: 21px; margin-top: 36px; }
	.jt-entry pre.wp-block-code, .jt-code pre { font-size: 14px; padding: 16px; }
	.jt-more__grid { grid-template-columns: 1fr; gap: 16px; }
	.jt-more__card { grid-template-columns: 110px minmax(0, 1fr); }
	.jt-more__img { height: 80px; }
	.jt-more__t { font-size: 17px; }
	.jt-page__card, .jt-article .jt-page__card { padding: 28px 20px; }
	.jt-page__title { font-size: 28px; }
}
@media (max-width: 420px) {
	.jt-theme button { width: 34px; min-height: 34px; }
	.jt-iconbtn { width: 40px; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 圖片放大（app.js）：點圖放大、再點或按右上 X、Esc 關閉 ---------- */
.jt-entry .wp-block-image img { cursor: zoom-in; }
.jt-lightbox { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 56px 24px 24px; background: rgba(6, 12, 20, .9); cursor: zoom-out; opacity: 0; transition: opacity .18s; }
.jt-lightbox.is-open { opacity: 1; }
.jt-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; }
.jt-lightbox__cap { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #DCE6F2; font-size: 15px; padding: 0 64px; pointer-events: none; }
.jt-lightbox__close { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 44px; cursor: pointer; }
.jt-lightbox__close:hover { background: rgba(255, 255, 255, .26); }
body.jt-noscroll { overflow: hidden; }
