/*
Theme Name: KLab Moral Magazine
Theme URI: https://github.com/liKyle/wp-moral-magazine-child
Description: klab.tw 使用的 Moral Magazine child theme。把原本直接改在 parent theme 裡的客製（閱讀時間、側邊欄廣告位、文章下方廣告、日期格式）搬進 child，讓 parent 可以正常更新而不會被洗掉。
Author: Kyle Li
Author URI: https://klab.tw/
Template: moral-magazine
Version: 0.1.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: klab-moral-magazine
Tags: blog, news, two-columns, right-sidebar, custom-menu, featured-images, translation-ready

⚠ 上面的 Version 是佔位符，不是版號。唯一來源是 VERSION 檔 ＋ bin/version.sh，
  打包（bin/build.sh）時才會填上真正的號。理由見 CLAUDE.md「版號怎麼來的」。

── 這份樣式的來源 ──────────────────────────────────────────────
下面「Moral Magazine Lite 的樣式」那一段，取自 Moral Themes 的
Moral Magazine Lite 1.0.3（GPL-3.0-or-later），未經修改：
  https://wordpress.org/themes/moral-magazine-lite/
本站原本就跑在那個 child theme 上，換成自己的 child 之後外觀要維持一致，
所以整段沿用。之後的「本站客製」才是自己寫的。
*/

/*--------------------------------------------------------------
# Moral Magazine Lite 的樣式（GPL-3.0-or-later, Moral Themes）
--------------------------------------------------------------*/
/*--------------------------------------------------------------
.   Second Design
--------------------------------------------------------------*/
body.second-design {
    background-color: #fff;
}
body.second-design , 
.second-design button, 
.second-design input, 
.second-design select, 
.second-design textarea {
    color: #1E2E4F;
}
.second-design .social-icons li a svg {
    fill: #1E2E4F;
}
.second-design .site-description,
.second-design .site-title a,
.second-design .posted-on a,
.second-design .byline a,
.second-design .post-categories a,
.second-design .entry-title a,
.second-design .trip-type a,
.second-design .comment a,
.second-design #secondary a, 
.second-design #secondary li, 
.second-design #secondary-sidebar a, 
.second-design #secondary-sidebar li,
.second-design #secondary .posted-on a, 
.second-design #secondary-sidebar .post-categories a,
{
    color: #000;
}

.second-design .main-navigation ul.nav-menu > li.home-icon > a > svg {
    fill: #fff;
}
.second-design #secondary .post-categories a {
    color: #fff;
}
.second-design .wrapper {
    width: 95%;
}

.second-design .post-categories a {
    text-transform: uppercase;
    font-size: 15px;
}
.second-design .post-categories {
    margin-bottom: 15px;
} 
.second-design .posted-on a:not(:last-child) {
    padding-right: 15px;
}
.second-design .posted-on a,
.second-design .comment a,
.second-design .trip-type,
.second-design .byline a {
    display: inline-flex;
    align-items: center;
}
.second-design .top-navigation-content p {
    margin: 0;
}
.second-design .top-navigation-content {
    float: left;
}
.second-design .top-navigation-container .entry-meta {
    margin-bottom: 0;
    float: right;
}

.byline a:before {
    background-image: url(assets/img/user.svg);
}

.second-design #top_navigation {
    border-bottom: 1px solid #7c7c7c99;
}
.second-design .top-navigation-container {
    padding: 10px 0;
}
.header-two input[type="search"] {
    border: unset;
    background-color: unset;
}
.header-two form.search-form button.search-submit {
    width: 50px;
    height: 50px;
}
.second-design .overlay {
    opacity: 0.4;
}
.second-design .post-categories a {
    color: #fff;
    background-color: #e6432a;
    padding: 4px 8px;
}
.second-design .post-categories a:hover,
.second-design .post-categories a:focus {
    background-color: #fff;
    color: #1E2E4F;
}
.second-design .section-title {
    font-size: 24px;
    position: relative;
}
.second-design .section-title, 
.second-design .widget-title, 
.second-design .widgettitle {
    background-color: unset;
    padding: 0;
    text-align: center;
    color: #1E2E4F;
}
.second-design .section-header, 
.second-design .widget-header {
    margin: 0 auto;
    text-align: center;
    position: relative;
}
.second-design .section-title:before,
.second-design .section-title:after,
.second-design .widget-title:before,
.second-design .widget-title:after {
    content: "";
    background-color: #1E2E4F;
    width: 800px;
    height: 2px;
    position: absolute;
    top: 18px;
    right: 100%;
    margin-right: 15px;
}
.second-design .widget-title {
    position: relative;
}
.second-design .widget-title:before,
.second-design .widget-title:after {
    height: 2px;
    width: 300px;
    top: 14px;
    background-color: #1E2E4F
}

.second-design .section-title:after,
.second-design .widget-title:after {
    right: unset;
    left: 100%;
    margin-right: 0;
    margin-left: 15px;
}

.second-design .same-background {
    padding-top: 0;
}

.second-design .main-navigation ul.nav-menu > li.home-icon > a > svg{
    fill: #e6432a;
}

.site-title a:hover,
.site-title a:focus,
.byline .author a i:hover,
.byline .author a i:focus,
.second-design .entry-title a:hover,
.second-design .entry-title a:focus,
.second-design .byline a:hover,
.second-design .byline a:focus,
.second-design .posted-on a:hover,
.second-design .posted-on a:focus,
.second-design .posted-on a:hover:before, 
.second-design .byline a:hover:before,
.second-design .posted-on a:focus:before, 
.second-design .byline a:focus:before,
.second-design .trip-type a:hover,
.second-design .trip-type a:focus,
.second-design .comment a:hover,
.second-design .comment a:focus 
.second-design .trip-type a:hover,
.second-design .trip-type a:focus,
.second-design .trip-type:hover:before,
.second-design .trip-type:focus:before {
    opacity: 1;
    color: #e6432a !important;
}
.second-design .comment a {
    text-decoration: none;
}

#colophon .widget-title, #colophon .widgettitle {
    font-size: 22px;
}

.lite-version .hero-banner-post .post-categories a, .lite-version .post-categories a{
    color: #fff;
}

#magazine_pro_breaking_news_section .entry-title a ,
.lite-version .hero-banner-post .post-categories a:hover, 
.lite-version .hero-banner-post .post-categories a:focus, 
.lite-version .post-categories a:focus,
.lite-version .post-categories a:hover{
    color: #000;
}

.breaking-news-post {
    background-color: #ffffff;
    position: relative;
    border: solid 2px #000;
}

.wp-block-latest-posts a{
    text-decoration: none;
}

.site-description,
.site-title a {
    color: #fff !important;
}

.second-design .hero-banner-sidebar .section-title{
    font-size: 15px;
}

.hero-banner-sidebar ul li.active:after{
    bottom: 10px;
}

.second-design .hero-banner-sidebar .section-title:after,
.second-design .hero-banner-sidebar .section-title:before{
    content: none;
}

.search .entry-title,
.blog .entry-title,
.archive .entry-title{
    font-size: 24px;
}

.widget-title, .widgettitle{
    font-size: 18px;
}

.widget-area .widget .entry-title a {
    font-size: 15px;
}
.second-design .widget-header{
    text-align: left;
}

.wp-block-search__input{
    border: 1px solid !important;
}

.posted-on a,
.entry-meta > span{
    font-size: 15px;
}

.lite-version #colophon .entry-meta > span:not(:first-child):before,
.lite-version #colophon .entry-meta > span {
    color: #fff;
}

.lite-version button.menu-toggle:focus,
.lite-version button.menu-toggle:hover {
    background-color: #000;
}
.lite-version button.menu-toggle.active:focus,
.lite-version button.menu-toggle:focus {
    border: 4px solid #f00;
    position: relative;
    z-index: 4;
}
.lite-version svg.icon-close {
    fill: #fff;
}

@media screen and (max-width: 567px){
    #magazine_pro_you_may_have_missed_section article:not(:last-child) {
        margin-bottom: 20px;
    }
    #magazine_pro_hero_banner_section .hero-banner-post article {
        width: 100%;
    }
}

@media screen and (min-width: 1025px){
    #page-site-header .page-title {
        font-size: 48px;
    }

    .site-title {
        font-size: 32px;
    }
}

@media screen and (min-width: 1900px){
    #magazine_pro_breaking_news_section .entry-title a,
    .widget-area .widget .entry-title a {
        font-size: 16px;
    }

    .aft-ripple {
        height: 70px;
        width: 60px;
    }

    #magazine_pro_breaking_news_section .news-title {
        padding: 27px 16px 29px 70px;
    }   

    #colophon ul li a {
        font-size: 16px;
    }
}

/*--------------------------------------------------------------
# 本站客製
--------------------------------------------------------------*/

/*
 * 取消 reading-time 前的分隔點 —— 換行時那個點會殘留在新行的起首。
 */
.entry-meta > span.reading-time:before {
	content: none;
}

/*
 * parent 給 mark／ins 上了黃色底（#fff9c0）。原本的做法是直接把 parent 的
 * 那條規則註解掉，但 child **不能刪掉 parent 的規則**，只能覆寫回去。
 */
mark,
ins {
	background: transparent;
	text-decoration: none;
}


/*--------------------------------------------------------------
# 原本放在「外觀 → 自訂 → 額外 CSS」的樣式
#
# 2026-09-09 從 theme_mod 的 custom_css 搬進來，**內容一字未改**。
#
# 為什麼搬：額外 CSS 是**按 theme slug 存**的（`custom_css` 文章），
# 換 theme 時不會跟著走 —— 換成這個 child theme 的當下它就整段失效了，
# 而且畫面不會報錯，只是樣式安靜地不見。放進 style.css 才會跟著 git 走、
# 跟著 theme 一起部署。
#
# ⚠ 之後要調樣式**改這裡**，不要再回去用「額外 CSS」——
#   兩邊都有的話，下次換 theme 又會丟掉其中一半。
--------------------------------------------------------------*/

p > code {
	margin-left:3px;
	margin-right:3px;
	padding-left: 5px;
	padding-right:5px;
	background-color:#ddddd3;
	border-radius:5px;
}
li > a.ez-toc-link {
	color: #555 !important;
}
.m-box-shadow {
	box-shadow:2px 2px 3px 3px #cccccc;
	border-radius:5px;
}
.m-box-shadow figcaption {
	border-top: 1px dotted #ddd;
	padding-bottom:3px;
	padding-left:3px;
}
div {
	/* --h2-color: #cacada; */
	--h2-color: #97D7E3;
	--h3-color: #e1eef7;
}
div.entry-content h2 {
	font-size: 40px;
	font-weight: bolder;
	margin-top: 1em;
	margin-bottom: 24px;
	padding-left: 0.3em;
	padding-top: 0px;
	padding-bottom: 5px;
	/*border-top: 3px solid #bbc;
	border-bottom: 3px solid #bbc;*/
	background-color: var(--h2-color);
}
div.entry-content h3 {
	font-weight: bolder;
	margin-top: 24px;
	margin-bottom: 24px;
	padding-bottom: 4px;
	border-bottom: 1px dashed #bbb;
}
div.entry-content ol {
	/* margin-bottom: 16px; */
}
figure.wp-block-table td {
	padding-top: 5px;
	padding-bottom: 5px;
	padding-left: 15px;
	padding-right: 15px;
}
pre.wp-block-code {
	padding-top: 5px;
	padding-bottom: 5px;
}
pre.wp-block-code.line-numbers > code {
	padding-bottom: 0px;
}
hr.wp-block-separator.is-style-dots {
	margin-top: -5px;
	margin-bottom: 0px;
}

input[type=search]#wp-block-search__input-1 {
	width: 150px;
}

#colophon .footer-widgets-area .widget > ul > li:last-child.wp-social-link {
	margin-bottom: 15px;
}
article>div.featured-image>img {
    max-height: 425px;
}

blockquote.wp-block-quote.is-layout-flow.wp-block-quote-is-layout-flow {
	padding-top: 12px;
	padding-bottom: 12px;
	margin-bottom: 24px;
}
/* Table style */
.my-table > table th {
	padding-top: 0.75em;
	padding-bottom: 0.75em;
	font-weight: bold;
	background-color: #D8EFFB;
}
.wp-block-table table thead tr th {
  word-break: keep-all;
  overflow-wrap: normal;
}
/* main wrapper max width */
@media screen and (min-width: 1024px) {
	.wrapper > div.site-branding-wrapper {
		max-width: 1280px;
		padding-left: 50px;
	}
	nav#site-navigation.main-navigation > div.wrapper {
		max-width: 1280px;
	}
	div#inner-content-wrapper.wrapper {
		max-width: 1280px;
	}
}
/* Google */
ins.adsbygoogle {
	background-color: white;
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}
/* fix title width */
@media screen and (min-width: 1025px) {
  div.site-branding {
    width: 100%;
  }
}
/* disable banner hover effect */
.single-wrapper article:hover .featured-image img {
  transform: none;
}
article>div.featured-image>img {
	max-height: 525px;
}
.wp-block-list {
	margin-bottom: 16px;
}
.wp-block-list > li {
	margin: 6px 0 6px;
}

/* Blog home banner 尺寸 */
@media screen and (min-width: 567px) {
	div.archive-blog-wrapper>article.post.type-post.status-publish {
		margin-bottom: 0px;
	}
	#single-column-news article .featured-image, .archive-blog-wrapper article .featured-image {
		margin-top: 43px;
		height: 70%;
	}
}

/* Post tags */
.entry-meta .tags-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #777;
}
.entry-meta .tags-links a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border: 1px solid #d6d6d6;
    border-radius: 999px;
    background: #fff;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.entry-meta .tags-links a::before {
    content: "#";
    color: #999;
    font-weight: 600;
}
.entry-meta .tags-links a:hover,
.entry-meta .tags-links a:focus {
    border-color: #aaa;
    background: #f5f5f5;
    color: #222;
    text-decoration: none;
}

/* 文章內圖片：柔和陰影 */
.single-post .entry-content img {
    border-radius: 10px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 8px 12px rgba(0, 0, 0, 0.06);
}
/* 避免圖片連結底線或奇怪邊框 */
.single-post .entry-content a img {
    border: none;
}
/* 文章圖片說明 */
.single-post .entry-content figcaption.wp-element-caption {
	color: #5a5a5a;
	font-size: 14px;
	text-align: center;
	font-style: normal;
}

/*--------------------------------------------------------------
# 深色模式
#
# 只認 <html data-theme="dark">。「跟隨系統」由 functions.php 的 inline script
# 在繪製前決定並寫上屬性，所以這裡**只要一套規則**，不必再寫一份
# @media (prefers-color-scheme: dark)。
#
# ⚠ parent theme 的顏色是寫死的（6000 多行、75 種色），不是 CSS 變數，
#   所以下面是逐個色面覆寫，不是「換一組變數就好」。加新版面時要回來補。
--------------------------------------------------------------*/

html[data-theme="dark"] {
	--k-bg: #14171a;          /* 頁面底色 */
	--k-surface: #1b1f23;     /* 內容區、卡片 */
	--k-surface-2: #22272c;   /* 次層：表頭、程式碼底、標籤 */
	/* 頁首那一條（站名／副標）。⚠ 一定要走這個變數 ——
	   這條橫條是**四個元素疊出來的**（見下面「頁首那一條」那一段），
	   直接寫色碼的話一定會漏掉其中一兩個，而漏掉的部分只在
	   視窗某些寬度才露出來（wrapper 有 max-width:1280px）。 */
	--k-header: #22272c;
	--k-fg: #d7dbdf;          /* 內文 */
	--k-fg-dim: #9aa3ab;      /* 次要文字、說明 */
	--k-fg-strong: #f2f5f7;   /* 粗體：淺色模式靠「更黑」強調，深色模式靠「更亮」 */
	--k-border: #2f353b;
	/* ⚠ 這個值不是照「對比夠不夠」挑的 —— 上一版 #7fb3ff 配頁面底色是 8.39，
	   早就超過 AAA 的 7.0，但**看起來還是暗**。原因 WCAG 量不到：
	   連結的相對亮度 0.44，而它周圍的內文字（--k-fg）是 0.70 ——
	   連結比內文字暗 1.6 倍。深色模式裡內文字是頁面上最亮的東西，
	   連結比它還暗就會讀起來「沉下去」。
	   #99c5ff 的亮度 0.54（底對比 10.10、卡片上 9.30），提亮但還留得住藍。
	   ⚠ 不要再往 #b3d4ff 那一階去：亮度 0.64 已經接近內文字，藍味會淡掉，
	   變成「比較亮的白字」而不是連結。 */
	--k-link: #99c5ff;
	--k-accent: #e6432a;      /* 品牌紅，深淺色共用 */

	color-scheme: dark;       /* 讓捲軸、表單控制項也跟著變深 */
}

/* ── 底層 ─────────────────────────────────────────────── */
html[data-theme="dark"] body,
html[data-theme="dark"] #page,
html[data-theme="dark"] #content,
html[data-theme="dark"] .site-main,
html[data-theme="dark"] .single-wrapper,
html[data-theme="dark"] .archive-blog-wrapper,
html[data-theme="dark"] #inner-content-wrapper {
	background-color: var(--k-bg);
	color: var(--k-fg);
}

html[data-theme="dark"] article,
html[data-theme="dark"] .widget-area,
html[data-theme="dark"] .comments-area {
	background-color: transparent;
	color: var(--k-fg);
}

/* ── 頁首與導覽 ───────────────────────────────────────── */
/* ⚠ 頁首與頁尾**刻意分開寫**：頁首那條橫條的顏色會單獨調（走 --k-header），
   頁尾維持最深的 #0f1214。原本兩者併在同一條，改頁首時會連頁尾一起變。 */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-branding-wrapper {
	background-color: var(--k-header);
	color: var(--k-fg);
}

html[data-theme="dark"] #colophon,
html[data-theme="dark"] .site-footer {
	background-color: #0f1214;
	color: var(--k-fg);
}

html[data-theme="dark"] .main-navigation,
html[data-theme="dark"] .main-navigation ul ul {
	background-color: #0f1214;
}

html[data-theme="dark"] .main-navigation a,
html[data-theme="dark"] .site-title a,
html[data-theme="dark"] .site-description {
	color: var(--k-fg);
}

html[data-theme="dark"] .search-field,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] textarea {
	background-color: var(--k-surface-2);
	border-color: var(--k-border);
	color: var(--k-fg);
}

html[data-theme="dark"] ::placeholder {
	color: var(--k-fg-dim);
}

/* ── 內文 ─────────────────────────────────────────────── */
html[data-theme="dark"] .entry-content,
html[data-theme="dark"] .entry-content p,
html[data-theme="dark"] .entry-content li,
html[data-theme="dark"] .entry-title,
html[data-theme="dark"] .entry-title a,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
	color: var(--k-fg);
}

html[data-theme="dark"] .entry-meta,
html[data-theme="dark"] .entry-meta a,
html[data-theme="dark"] .reading-time,
html[data-theme="dark"] .posted-on,
html[data-theme="dark"] figcaption,
html[data-theme="dark"] .wp-element-caption {
	color: var(--k-fg-dim);
}

/* ⚠⚠ 上面那條在**文章頁打不贏**，所以這條不是重複，不要「順手合併」。
   文章圖片說明另外有一條 `.single-post .entry-content figcaption.wp-element-caption`
   （style.css 574，從站台的「額外 CSS」整合進來的），特異度 **(0,3,1)**；
   上面那條是 `html[data-theme="dark"] .wp-element-caption`，只有 **(0,2,1)** ——
   輸了，於是深色模式下圖片說明維持淺色模式的 `#5a5a5a`。
   ⚠ 症狀是「字還在、位置也對，只是暗到看不清楚」：對比 **2.61**（AA 要 4.5），
   而且 grep 得到上面那條，會以為深色已經處理過了。2026-09-12 使用者回報才發現。
   → 要蓋過 (0,3,1)，這條把 `.single-post .entry-content` 也寫進來，成為 (0,4,2)。 */
html[data-theme="dark"] .single-post .entry-content figcaption.wp-element-caption {
	/* --k-fg-dim 對 --k-bg 的對比是 7.02（AAA）；註解本來就該比內文暗一階，
	   但 #5a5a5a 的 2.61 是「看不見」，不是「低調」。 */
	color: var(--k-fg-dim);
}

html[data-theme="dark"] .entry-content a {
	color: var(--k-link);
}

html[data-theme="dark"] hr,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .comments-area {
	border-color: var(--k-border);
}

/* ── 上面「額外 CSS」那一節的對應深色版 ───────────────── */

/*
 * h2／h3 的底色。
 *
 * ⚠⚠ 這裡**必須寫成 `html[data-theme="dark"] div`，不能只寫 `html[data-theme="dark"]`**。
 *   上面那段從額外 CSS 搬來的樣式把變數定義在 `div { --h2-color: … }` 上 ——
 *   也就是**每一個 div 都自己定義了一次**。CSS 變數是從「最近的、有定義的祖先」
 *   繼承的，`div.entry-content` 本身就是 div，所以它拿到的永遠是那個淺藍值，
 *   定義在 `html` 上的深色版根本輪不到。
 *
 *   踩過（2026-09-09）：深色模式下 h2 變成**淺灰字配淺藍底，等於看不見**，
 *   而且 CSS 完全合法、devtools 也不會標成被覆寫 —— 是使用者回報才發現。
 */
html[data-theme="dark"] div {
	--h2-color: #1e3a45;
	--h3-color: #223038;
}

/* 再直接指定一次底色，不依賴變數解析順序 */
html[data-theme="dark"] div.entry-content h2 {
	background-color: #1e3a45;
	color: #eaf4f8;
}

html[data-theme="dark"] div.entry-content h3 {
	border-bottom-color: var(--k-border);
}

/* 行內 code */
html[data-theme="dark"] p > code {
	background-color: var(--k-surface-2);
	color: #e8c9a0;
}

/* 表格 */
html[data-theme="dark"] .wp-block-table table,
html[data-theme="dark"] figure.wp-block-table td,
html[data-theme="dark"] .wp-block-table th {
	border-color: var(--k-border);
	color: var(--k-fg);
}

html[data-theme="dark"] .my-table > table th,
html[data-theme="dark"] .wp-block-table table thead tr th {
	background-color: var(--k-surface-2);
	color: var(--k-fg);
}

/* 引言 */
html[data-theme="dark"] blockquote.wp-block-quote {
	border-color: var(--k-border);
	color: var(--k-fg-dim);
}

/* 標籤（膠囊） */
html[data-theme="dark"] .entry-meta .tags-links a {
	background: var(--k-surface-2);
	border-color: var(--k-border);
	color: var(--k-fg);
}

html[data-theme="dark"] .entry-meta .tags-links a:hover,
html[data-theme="dark"] .entry-meta .tags-links a:focus {
	background: #2b3238;
	border-color: #444c53;
	color: #fff;
}

/* 目錄外掛 */
html[data-theme="dark"] div#ez-toc-container,
html[data-theme="dark"] .ez-toc-title-container {
	background: var(--k-surface);
	border-color: var(--k-border);
}

html[data-theme="dark"] li > a.ez-toc-link {
	color: var(--k-link) !important;
}

/* 廣告：白底方塊在深色頁面上非常突兀，改成表面色 */
html[data-theme="dark"] ins.adsbygoogle {
	background-color: var(--k-surface);
}

html[data-theme="dark"] .m-box-shadow {
	box-shadow: 2px 2px 3px 3px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .m-box-shadow figcaption {
	border-top-color: var(--k-border);
}

/* 文章內圖片的柔和陰影在深色下要更深才看得出來 */
html[data-theme="dark"] .single-post .entry-content img {
	box-shadow:
		0 4px 12px rgba(0, 0, 0, 0.45),
		0 8px 12px rgba(0, 0, 0, 0.35);
}

/*--------------------------------------------------------------
# 切換鈕（放在主選單最後）
--------------------------------------------------------------*/

/* ⚠ 選擇器要含 tag 與 `.menu-item`：parent 用 `.nav-menu li { display:inline-block }`
   之類的規則把 li 釘住，單一 class 的 (0,1,0) 打不贏，`display:flex` 會靜靜地無效。 */
li.menu-item.klab-theme-toggle-item {
	display: inline-flex;
	align-items: center;
	/* 選單列的 <a> 高 64px（18px padding ＋ 28px 行高），這個 li 只有鈕的 38px。
	   inline-block 預設 `vertical-align: baseline`，而沒有行內文字的 inline-block
	   是拿**下緣**當基線 —— 結果鈕會比鄰居的文字高 2px。
	   ⚠ 2px 說不出哪裡怪，但看起來就是沒對齊。
	   改成靠上對齊、上下各補 (64 − 38) ÷ 2 = 13px。
	   ⚠ 13 這個數字跟著 parent 的選單 <a> padding 走，parent 改版要回來量一次
	   （量法：scripts/contrast-audit.js 旁邊那組 CDP 腳本，比鈕與鄰居 <a> 的中心 y）。 */
	vertical-align: top;
	padding: 13px 0;
}

/* ⚠ 選擇器要寫成 `button.klab-theme-toggle`（含 tag），不能只寫 class ——
   上面從「額外 CSS」搬進來的那段有 `.second-design button { color:#1E2E4F }`，
   特異度 (0,1,1) 比單一 class 的 (0,1,0) 高。只寫 class 的話這裡的 color 不會生效，
   而且畫面上只看得出「切換鈕看不見」，看不出是誰蓋的。 */
button.klab-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	/* 圖示本身就是鈕，不畫外框 —— 旁邊都是純文字選單，
	   多一圈 38px 的圓框只會讓它看起來像個異物。hover 才浮出淡底。 */
	border: 0;
	border-radius: 10px;
	background: transparent;
	/* ⚠ 不要寫 `color: inherit`：它繼承的是 <li>，而選單的白色是設在 <a> 上的，
	   結果會拿到 theme 的預設 #1e2e4f，配 #202020 的選單列對比 1.22，等於看不見。 */
	color: #fff;
	cursor: pointer;
	line-height: 1;
	/* ⚠ 不要小於 38px：手指點得到的最小尺寸。圖示只有 18px，
	   鈕面積跟圖示大小是兩件事，不要因為拿掉框就一起縮。 */
}

button.klab-theme-toggle:hover,
button.klab-theme-toggle:focus-visible {
	background: rgba(255, 255, 255, 0.14);
}

/* 點下去會冒出一圈虛線框 —— 那是 parent 的
 *   `button:focus, …, button:active { border-color:…; outline: thin dotted }`（0,1,1）。
 * ⚠ 不是 border：我們的 `border: 0` 已經把寬度壓成 0，畫面上那圈是 **outline**。
 *   只盯著 border 找會找不到東西，要量 `outline-style`（見下面的量法）。
 * ⚠ `:active` 也要寫。parent 那條把 `:focus` 與 `:active` 併在同一組，
 *   而 `:active` 不隱含 `:focus` —— 只關掉 `:focus` 的話，
 *   **按住滑鼠不放的那一瞬間**虛線框還是會閃出來。
 * ⚠ 特異度：`button.klab-theme-toggle:focus` 是 (0,2,1)，贏過 parent 的 (0,1,1)。
 *   少寫 tag 的話是 (0,2,0)，跟 parent 同分、靠載入順序決定，很脆。 */
button.klab-theme-toggle:focus,
button.klab-theme-toggle:active {
	outline: 0;
}

/* ⚠⚠ 不可以只寫上面那條就收工。 用鍵盤 Tab 的人**只剩焦點框可以看**，
 *   拿掉等於他不知道自己選到哪裡。滑鼠點的時候瀏覽器不會讓按鈕符合
 *   `:focus-visible`，鍵盤過來才會 —— 所以「點了沒框、Tab 有框」是同時成立的。
 * ⚠ 只靠上面那個 hover 底色當焦點提示不夠：#202020 疊 14% 白只到 #3F3F3F，
 *   前後對比 1.62，WCAG 2.2 的 2.4.11 要 3.0。要真的畫一圈。
 * ⚙ 2px 是 2.4.11 的最低厚度，offset 2px 讓它離開鈕面、不跟圖示黏在一起。
 *   用 currentColor：桌機選單列是白字 → 白框；手機淺色選單是 #333 → 深框。 */
button.klab-theme-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* 圖示用 CSS 畫，不依賴字型圖示 —— parent 的 Font Awesome 哪天換掉也不會變空白 */
.klab-theme-toggle__icon {
	display: block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: currentColor;
	transition: box-shadow 0.25s ease, width 0.25s ease, height 0.25s ease;
}

/* 淺色模式時顯示「月亮」＝點了會變深色。
 * ⚙ 這邊寫了八道透明的 box-shadow，看起來多餘 —— 它們是給下面太陽光芒插值用的。
 *   寫 `none` 的話 `none → 八道陰影` 不能插值，切換會硬跳。 */
html:not([data-theme="dark"]) .klab-theme-toggle__icon {
	background: radial-gradient(circle at 70% 35%, transparent 55%, currentColor 56%);
	box-shadow:
		0 -9.5px 0 -3px transparent,       0 9.5px 0 -3px transparent,
		-9.5px 0 0 -3px transparent,       9.5px 0 0 -3px transparent,
		6.72px 6.72px 0 -3px transparent,  -6.72px 6.72px 0 -3px transparent,
		6.72px -6.72px 0 -3px transparent, -6.72px -6.72px 0 -3px transparent;
}

/* 深色模式時顯示「太陽」＝點了會變淺色。
 * ⚠ 不要只留實心圓 —— 沒有光芒的圓點讀起來是 radio 鈕，不是太陽，
 *   而且跟淺色模式的月牙視覺重量差很多，切換時會「跳」。
 * ⚙ 光芒間距要算：圓心直徑 9 → 半徑 4.5；光芒點直徑 = 9 + 2×(-3) = 3，
 *   中心距離 9.5 → 內緣 8，空隱 3.5px。拉太近會糊成一團（踩過）。
 *   斜向的偏移是 9.5 / √2 = 6.72。 */
html[data-theme="dark"] .klab-theme-toggle__icon {
	width: 9px;
	height: 9px;
	background: currentColor;
	box-shadow:
		0 -9.5px 0 -3px currentColor,       0 9.5px 0 -3px currentColor,
		-9.5px 0 0 -3px currentColor,       9.5px 0 0 -3px currentColor,
		6.72px 6.72px 0 -3px currentColor,  -6.72px 6.72px 0 -3px currentColor,
		6.72px -6.72px 0 -3px currentColor, -6.72px -6.72px 0 -3px currentColor;
}

/* ── 深色模式：第二輪修正（截圖看出來的）───────────────────
 * 第一版漏了三片白：html 本身、側邊欄的 widget、以及區塊編輯器產生的
 * wp-block-* 容器。⚠ 這些都不是 parent 的 class，是 WordPress 區塊自己的，
 * 只覆寫 parent 的選擇器不會蓋到。
 * ------------------------------------------------------------ */

html[data-theme="dark"] {
	/* 只設 body 的話，捲到底或視窗比內容寬時會露出瀏覽器的預設底色 */
	background-color: var(--k-bg);
}

html[data-theme="dark"] .widget,
html[data-theme="dark"] .widget_block,
html[data-theme="dark"] .wp-block-group,
html[data-theme="dark"] .wp-block-group__inner-container,
html[data-theme="dark"] .wp-block-search,
html[data-theme="dark"] div#ez-toc-container {
	background-color: var(--k-surface);
	color: var(--k-fg);
	border-color: var(--k-border);
}

html[data-theme="dark"] .widget-title,
html[data-theme="dark"] .wp-block-heading,
html[data-theme="dark"] .wp-block-search__label {
	color: var(--k-fg);
}

html[data-theme="dark"] .widget a,
html[data-theme="dark"] .wp-block-latest-posts a,
html[data-theme="dark"] .wp-block-latest-posts__post-title {
	color: var(--k-link);
}

html[data-theme="dark"] .wp-block-search__input {
	background-color: var(--k-surface-2);
	border-color: var(--k-border);
	color: var(--k-fg);
}

html[data-theme="dark"] .wp-block-search__button,
html[data-theme="dark"] .wp-element-button {
	background-color: var(--k-surface-2);
	border-color: var(--k-border);
	color: var(--k-fg);
}

/* 標籤雲：**不要**給它底色。
 *
 * ⚠⚠ 這裡原本有一組規則，給每個標籤一塊 `var(--k-surface-2)` 的底，
 *   註解寫「白底小方塊在深色下最刺眼」—— **那個前提是錯的**。
 *   parent 根本沒有為標籤雲上任何色（`grep tag-cloud-link parent 的 style.css` 是空的），
 *   淺色模式量出來 `background-color` 就是 `transparent`。
 *   等於深色模式**自己憑空生出一塊底**，而且 `padding` 是 0 —— 色塊緊貼著字，
 *   看起來像沒切乾淨的反白，跟旁邊的連結完全不協調。使用者回報後才發現。
 *
 * ⚠ 教訓：寫深色覆寫之前，先**量淺色模式實際長什麼樣**，
 *   不要照「它在別的 theme 應該是白的」去推。深色模式是覆寫層，
 *   沒有東西可覆寫的時候就不該寫。
 *
 * 顏色與 hover 都不必另外寫：`#secondary .widget a`（連結色）與
 *   `#secondary .widget a:hover`（深→#fff、淺→品牌紅）本來就蓋得到它們。
 */

/* 目錄外掛的內層與標題 */
html[data-theme="dark"] div#ez-toc-container .ez-toc-title,
html[data-theme="dark"] div#ez-toc-container nav ul li a {
	color: var(--k-fg);
}

html[data-theme="dark"] div#ez-toc-container .ez-toc-list ul {
	background: transparent;
}

/* 廣告：外框跟著暗，但 ins 本身留白 —— 廣告內容多半是為白底設計的 */
/*
 * 廣告：素材多半為白底設計，所以填充到廣告時給白底；
 * ⚠ 但**沒填充到的時候不能給白底** —— 深色頁面上會出現一整塊白色大方塊。
 *   Google 的 script 會在 <ins> 上標 data-ad-status，用它區分。
 */
html[data-theme="dark"] ins.adsbygoogle[data-ad-status="filled"] {
	background-color: #fff;
	border-radius: 6px;
}

html[data-theme="dark"] ins.adsbygoogle[data-ad-status="unfilled"] {
	display: none;
}

/* ── 深色模式：第三輪修正 ────────────────────────────────
 * ① 頁首的灰色不是 .site-header 畫的，是它裡面的 .header-image
 *    （帶一個空的 inline background-image）與 .site-branding-container 蓋上去的。
 * ② 側邊欄仍有零星白色區塊 —— parent 與區塊編輯器的容器太多、
 *    一個一個猜會沒完，改成「側邊欄內的容器一律透明，白底只留給 .widget 本身」。
 * ------------------------------------------------------------ */

/* ⚠ `header#masthead` (1,1,2) **打不贏** parent 的
 *   `.lite-version.default-design #masthead { background:#fff }` (1,2,0)：
 *   同樣一個 id，但對方多一個 class。所以要補 `body.lite-version` 湊到 (1,2,2)。
 *   ⚠ 這條在畫面上完全看不出來 —— 桌機時 `.site-branding-container` 疊在上面、
 *   剛好也是深色，白底被蓋住了。是量 computed background 才發現它一直沒生效。 */
html[data-theme="dark"] .site-branding-container,
html[data-theme="dark"] .header-image,
html[data-theme="dark"] .site-branding-wrapper,
html[data-theme="dark"] body.lite-version header#masthead,
html[data-theme="dark"] header#masthead {
	/* 只覆寫顏色，不動 background-image —— 使用者哪天設了頁首圖還是要顯示 */
	background-color: var(--k-header);
}

html[data-theme="dark"] .header-image > .overlay {
	background-color: transparent;
}

/* （第三輪的側邊欄掃描已移除，見下方說明）*/


/* ── 深色模式：側邊欄與表單（特異度之戰）──────────────────
 * parent 有這條：
 *   body.single.lite-version #secondary .widget { background-color: #fff }
 * 特異度 (1,4,1)。深色模式的規則只有 (0,2,1)，所以側邊欄一直是白的
 * —— 而且**畫面上只看得出「白」，看不出是誰畫的**，是逐條比對 parent 的
 * CSS 才找到的。
 *
 * ⚠ 這裡用 !important，不去湊更長的選擇器：對方的選擇器鏈（body.single…、
 *   body.blog…、.lite-version…）會隨版本變，比特異度是追不完的。
 *   深色模式本來就是覆寫層，用 !important 是這一層該有的權重。
 * ------------------------------------------------------------ */

html[data-theme="dark"] #secondary .widget,
html[data-theme="dark"] .widget-area .widget {
	background-color: var(--k-surface) !important;
	color: var(--k-fg) !important;
}

html[data-theme="dark"] #secondary .widget h2,
html[data-theme="dark"] #secondary .widget .wp-block-heading,
html[data-theme="dark"] #secondary .widget .widget-title,
html[data-theme="dark"] #secondary .widget .wp-block-search__label {
	color: var(--k-fg) !important;
}

html[data-theme="dark"] #secondary .widget a {
	color: var(--k-link) !important;
}

/* parent 也把全站的輸入框、pre、blockquote、留言釘成白底 */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] .wp-block-search__input {
	background-color: var(--k-surface-2) !important;
	border-color: var(--k-border) !important;
	color: var(--k-fg) !important;
}

html[data-theme="dark"] blockquote,
html[data-theme="dark"] .comment-content,
html[data-theme="dark"] .navigation.post-navigation,
html[data-theme="dark"] .navigation.posts-navigation {
	background-color: var(--k-surface) !important;
	color: var(--k-fg) !important;
}

/* ⚠ 程式碼區塊不要碰 —— 它的底色是 Prism 佈景在管的，
 *   覆寫掉的話語法高亮的對比會壞掉。 */
html[data-theme="dark"] pre:not(.wp-block-code) {
	background-color: var(--k-surface) !important;
	color: var(--k-fg) !important;
}

/* ── 深色模式：第四輪修正（parent 把文字釘成 #000 的地方）──────────
 *
 * 症狀：深色底上出現**整段黑字**——粗體、作者、日期、上一篇／下一篇標題、
 * 瀏覽次數。前三輪修的是「白色的面」，這一輪修的是「黑色的字」。
 *
 * 原因：parent 有兩條超長的選擇器清單把文字釘死成 #000，例如
 *   .lite-version, .lite-version h1 … .lite-version b, .lite-version strong … { color:#000 }
 *   .lite-version .posted-on a, … .lite-version .entry-meta > span      { color:#000 }
 * ⚠ `lite-version` 這個 body class 是**我們自己加的**（沿用 lite 的版面），
 *   所以這些規則一定會命中，不是意外。
 *
 * 特異度：對方 (0,2,0)～(0,3,1)，而 `html[data-theme="dark"] X` 只有 (0,2,1)，
 * 又排在 parent 之後同分時才贏 —— 追不完。照這個檔上面已經定下的做法用
 * `!important`：深色模式本來就是覆寫層。
 *
 * ⚠ 程式碼區塊（`pre.wp-block-code`／`code`／`.token`）一律不碰，
 *   那是 Prism 佈景在管的，碰了語法高亮的配色就壞了。
 * ------------------------------------------------------------ */

/* ① 粗體 —— 使用者最先看到的那一塊 */
html[data-theme="dark"] b,
html[data-theme="dark"] strong {
	color: var(--k-fg-strong) !important;
}

/* 連結裡的粗體要跟著連結的顏色走，不然變成亮白字看起來不像連結 */
html[data-theme="dark"] a b,
html[data-theme="dark"] a strong {
	color: inherit !important;
}

/* ② 文章的 meta（作者、日期、分類、瀏覽次數…）
 *    ⚠ `.entry-meta > span` 這一條也順便蓋掉第三方外掛塞進來的
 *      `<div class="… entry-meta"><span class="post-views-…">`。 */
html[data-theme="dark"] .entry-meta,
html[data-theme="dark"] .entry-meta > span,
html[data-theme="dark"] .entry-meta a,
html[data-theme="dark"] .entry-meta > span a,
html[data-theme="dark"] .entry-meta time,
html[data-theme="dark"] .byline,
html[data-theme="dark"] .byline a,
html[data-theme="dark"] .byline i,
html[data-theme="dark"] .posted-on,
html[data-theme="dark"] .posted-on a,
html[data-theme="dark"] .author.vcard a,
html[data-theme="dark"] .comments-link a,
html[data-theme="dark"] .reading-time {
	color: var(--k-fg-dim) !important;
}

html[data-theme="dark"] .entry-meta a:hover,
html[data-theme="dark"] .entry-meta a:focus,
html[data-theme="dark"] .byline a:hover,
html[data-theme="dark"] .byline a:focus,
html[data-theme="dark"] .posted-on a:hover,
html[data-theme="dark"] .posted-on a:focus,
html[data-theme="dark"] .author.vcard a:hover,
html[data-theme="dark"] .author.vcard a:focus {
	color: var(--k-fg) !important;
}

/* ⚠ 標籤膠囊也長在 .entry-meta 底下，會被上面那條 !important 蓋成暗灰。
 *   它在這個檔更前面就設過一次（沒有 !important），所以要在這裡再宣告一次。 */
html[data-theme="dark"] .entry-meta .tags-links a {
	color: var(--k-fg) !important;
}

html[data-theme="dark"] .entry-meta .tags-links a:hover,
html[data-theme="dark"] .entry-meta .tags-links a:focus {
	color: #fff !important;
}

/* ③ 標題連結（首頁／彙整頁的文章標題，parent 釘成 #000） */
html[data-theme="dark"] .entry-title,
html[data-theme="dark"] .entry-title a {
	color: var(--k-fg) !important;
}

/* ④ 上一篇／下一篇：黑字寫在 <a> 上，標題文字包在裡面的 <span> 靠繼承 */
html[data-theme="dark"] .navigation.post-navigation a,
html[data-theme="dark"] .navigation.posts-navigation a,
html[data-theme="dark"] .navigation.post-navigation a span,
html[data-theme="dark"] .navigation.posts-navigation a span {
	color: var(--k-fg) !important;
}

/* ⑤ 所有連結的 hover／focus —— parent 寫的是 `a:hover{color:#000}`，
 *    深色模式下滑過去等於字消失。這條在截圖上永遠看不到，只有真的滑過才會遇到。 */
html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus,
html[data-theme="dark"] a:active {
	color: #fff !important;
}

/* ⑥ 主選單：子選單與「目前所在」的項目是 #333，深色頁首上幾乎看不見。
 *    ⚠ 子選單平常 display:none，截圖與對比度掃描都掃不到。 */
html[data-theme="dark"] .main-navigation a,
html[data-theme="dark"] .main-navigation ul.nav-menu > li > a,
html[data-theme="dark"] .main-navigation ul.sub-menu li a,
html[data-theme="dark"] .main-navigation .current_page_item > a,
html[data-theme="dark"] .main-navigation .current-menu-item > a,
html[data-theme="dark"] .main-navigation .current_page_ancestor > a,
html[data-theme="dark"] .main-navigation .current-menu-ancestor > a {
	color: var(--k-fg) !important;
}

/* ⑦ 留言區與留言表單 */
html[data-theme="dark"] .comment-content,
html[data-theme="dark"] .comment-content p,
html[data-theme="dark"] .comment-meta .fn,
html[data-theme="dark"] #respond label,
html[data-theme="dark"] cite {
	color: var(--k-fg) !important;
}

html[data-theme="dark"] .comment a,
html[data-theme="dark"] .comment-meta .url,
html[data-theme="dark"] .comment-metadata a,
html[data-theme="dark"] .comment-metadata a time {
	color: var(--k-link) !important;
}

/* ⑧ 表格表頭、頁籤、副標 */
html[data-theme="dark"] table th,
html[data-theme="dark"] ul.tabs li a,
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .section-subtitle a {
	color: var(--k-fg) !important;
}

/* ⑧-2 分頁的數字方塊
 *
 * ⚠ 這裡**不能只改文字顏色**：parent 把方塊畫成 `background-color:#fff`，
 *   只把字改成淺灰就變成「淺灰字配白底」（對比 1.39），比原本的黑字還糟。
 *   踩過 —— 第一版只寫了 color，是掃首頁的對比度才發現的，文章頁沒有分頁所以掃不到。
 */
html[data-theme="dark"] .pagination .page-numbers {
	background-color: var(--k-surface-2) !important;
	border-color: var(--k-border) !important;
	color: var(--k-fg) !important;
}

/* 目前這一頁與滑過的那一顆維持品牌紅底白字（跟淺色模式一樣） */
html[data-theme="dark"] .pagination .page-numbers.current,
html[data-theme="dark"] .pagination .page-numbers:hover,
html[data-theme="dark"] .pagination .page-numbers:focus {
	background-color: var(--k-accent) !important;
	border-color: var(--k-accent) !important;
	color: #fff !important;
}

/* ⑨ 側邊欄 widget 裡被單獨釘成 #000 的時間戳與編號
 *    （`#secondary .widget a` 那條蓋不到，因為黑色是設在 <time> 上，不是 <a>） */
html[data-theme="dark"] #secondary .widget time,
html[data-theme="dark"] #secondary .widget a time,
html[data-theme="dark"] .widget_popular_news .post-number {
	color: var(--k-fg-dim) !important;
}

/*--------------------------------------------------------------
# 文章下方廣告的「贊助標示」
#
# 這段樣式原本用 inline style 寫在 functions.php 裡。inline 的顏色
# **深色模式覆寫不掉**（除非整條 !important），所以改成 class。
--------------------------------------------------------------*/

.klab-after-post-ad__label {
	margin: 0;
	font-size: 12px;
	letter-spacing: .08em;
	text-align: center;
	color: #777;   /* 與改成 class 之前的 inline style 一模一樣 */
}

html[data-theme="dark"] .klab-after-post-ad__label {
	color: var(--k-fg-dim);
}

/* ⑩ hover 的特異度要打得贏「自己」
 *
 * ⚠ 上面 ⑤ 那條 `a:hover{color:#fff!important}` 只有 (0,2,1)，而這個檔更前面的
 *   `#secondary .widget a`（1,2,1）、`.main-navigation a`（0,2,1，但排在後面）、
 *   `.navigation.post-navigation a`（0,3,1）都帶 !important —— 結果是**滑過去
 *   顏色完全不變**，深色模式沒有任何 hover 回饋，而淺色模式有。
 *   這種「少了回饋」在截圖與對比度掃描上都看不出來，只有真的滑過去才知道。
 */
html[data-theme="dark"] #secondary .widget a:hover,
html[data-theme="dark"] #secondary .widget a:focus,
html[data-theme="dark"] .main-navigation a:hover,
html[data-theme="dark"] .main-navigation a:focus,
html[data-theme="dark"] .main-navigation ul.nav-menu > li > a:hover,
html[data-theme="dark"] .main-navigation ul.nav-menu > li > a:focus,
html[data-theme="dark"] .main-navigation ul.sub-menu li a:hover,
html[data-theme="dark"] .main-navigation ul.sub-menu li a:focus,
html[data-theme="dark"] .navigation.post-navigation a:hover,
html[data-theme="dark"] .navigation.post-navigation a:focus,
html[data-theme="dark"] .navigation.posts-navigation a:hover,
html[data-theme="dark"] .navigation.posts-navigation a:focus {
	color: #fff !important;
}

/* ── 深色模式：第五輪 —— SVG 圖示走的是 `fill`，不是 `color` ──────────
 *
 * 症狀：上一篇／下一篇的箭頭在深色底上**還是黑的**（對比 1.27），
 * 而它旁邊的標題文字已經修好了。
 *
 * 原因：那些箭頭是 `<svg><use href="#icon-left"></svg>`，顏色由 `fill` 決定。
 * 上面第四輪覆寫的全部是 `color` —— **一條都蓋不到它們**。
 * parent 那條是：
 *   .lite-version .navigation.post-navigation svg,
 *   .lite-version .navigation.pagination svg,
 *   .lite-version .social-icons li a svg … { fill: #000 }
 *
 * ⚠ 這一類東西**文字對比度掃描抓不到**（它沒有文字節點），截圖上也只是
 *   「深色底上一塊更深的東西」，看起來像那裡本來就沒有圖示。
 *   驗圖示要另外量 `fill`，見 repo `CLAUDE.md`「驗收」。
 *
 * ⚠ 用 Font Awesome／dashicons 那種**字型圖示**（`<i class="fa …">`）不在這裡 ——
 *   它們是文字，吃 `color`，第四輪的 `.entry-meta` 那條已經一起修掉了。
 *   不要為了「看起來一致」也給它們 fill，那沒有任何作用。
 * ------------------------------------------------------------ */

html[data-theme="dark"] .navigation.post-navigation svg,
html[data-theme="dark"] .navigation.posts-navigation svg,
html[data-theme="dark"] .navigation.pagination svg,
html[data-theme="dark"] .search-menu svg.icon-search,
html[data-theme="dark"] svg.icon-close,
html[data-theme="dark"] .social-icons li a svg,
html[data-theme="dark"] #colophon .social-icons li svg,
html[data-theme="dark"] #masthead .main-navigation .social-menu a svg {
	fill: var(--k-fg) !important;
}

/* 滑過時提亮。分頁滑過去是紅底，白色箭頭才看得見。 */
html[data-theme="dark"] .navigation.post-navigation a:hover svg,
html[data-theme="dark"] .navigation.post-navigation a:focus svg,
html[data-theme="dark"] .navigation.posts-navigation a:hover svg,
html[data-theme="dark"] .navigation.posts-navigation a:focus svg,
html[data-theme="dark"] .navigation.pagination a:hover svg,
html[data-theme="dark"] .navigation.pagination a:focus svg,
html[data-theme="dark"] .social-icons li a:hover svg,
html[data-theme="dark"] .social-icons li a:focus svg {
	fill: #fff !important;
}

/* 切換鈕的圖示是用 `background: currentColor` 畫的，所以它的顏色就是上面那個
 * `color`。⚠ 這種畫法**文字掃描與 svg 掃描都抓不到** —— 它既不是文字節點，
 * 也不是 <svg>。踩過：從第一版起它就是深藍配深灰，深淺兩種模式都看不見。 */
html[data-theme="dark"] button.klab-theme-toggle {
	color: var(--k-fg);
}

/* entry-meta 各項之間的分隔點：parent 用 `::before { content:"."; color:#000 }` 畫的。
 * ⚠ 偽元素**不會**跟著我們設在 span 上的顏色走 —— parent 明確給了它 #000，
 *   所以深色模式下那幾個點是黑的（對比 1.17），整排 meta 看起來少了分隔。
 *   偽元素既不是文字節點也不是 <svg>，兩種掃描都抓不到，要專門量。 */
html[data-theme="dark"] .entry-meta > span:before {
	color: var(--k-fg-dim) !important;
}

/*--------------------------------------------------------------
# 區塊按鈕的字色（深淺兩種模式都會遇到）
#
# 症狀：側邊欄「搜尋」按鈕是**深藍字配深灰底**（#1E2E4F 配 #32373c，對比 1.12），
# 淺色模式下等於看不見。
#
# 原因：WordPress 核心給區塊按鈕的預設是深底白字，但它寫成
#   `:root :where(.wp-element-button, .wp-block-button__link) { background:#32373c; color:#fff }`
# —— `:where()` 的特異度是 **0**，所以上面從「額外 CSS」搬進來的
#   `.second-design button { color:#1E2E4F }`（0,1,1）輕鬆蓋掉它的 color，
#   卻蓋不掉 background（那條沒被覆寫），於是變成深藍配深灰。
#
# ⚠ 選擇器要含 tag（`button.wp-block-search__button`，0,1,1）才打得贏；
#   只寫 class 是 (0,1,0)，一樣輸給 `.second-design button`。同切換鈕那個坑。
# ⚠ **不要**改成覆寫 `.wp-element-button` 全部 —— 那會蓋掉使用者在編輯器裡
#   自己挑的按鈕顏色（`.has-*-color` 也只有 (0,1,0)）。只修壞掉的這一個。
--------------------------------------------------------------*/

button.wp-block-search__button,
input.wp-block-search__button {
	color: #fff;
}


/*--------------------------------------------------------------
# 深色模式：第六輪 —— 手機的滑出選單
--------------------------------------------------------------*/
/* ⚠ 這一塊只在**視窗 ≤1024px 而且把漢堡選單打開**時才看得到，
 *   桌機的截圖與掃描全部掃不到它。踩過（2026-09-09）：深色模式下滑出選單
 *   整片是白底，而文字已經被我們改成 var(--k-fg) 的淺灰 —— 對比 1.3，
 *   等於整個選單看不見，但線上跑了好幾輪都沒人發現。
 *
 *   驗法：CDP 開 390px 視窗 → 點 `.menu-toggle` → 再量。 */
@media screen and (max-width: 1024px) {
	/* parent：`.main-navigation ul.nav-menu { background:#fff }` (0,2,2)。
	   我們用 (0,3,3) 蓋掉，改成透明 —— 讓底下 `#site-navigation` 的深色透出來，
	   不要再指定一個新顏色，免得跟頁首各自漂走。 */
	html[data-theme="dark"] .main-navigation ul.nav-menu {
		background-color: transparent;
	}

	/* ⚠ 淺色模式：滑出選單的面板是**白的**，而切換鈕的 `color:#fff` 是為了
	 *   桌機那條 #202020 的深色選單列設的 —— 到了手機就變成白圖示配白面板，
	 *   對比 1.00，整顆鈕消失。桌機截圖永遠看不到這一格。
	 *   #333 是 parent 給手機選單連結的顏色（量法：開 390px、點開漢堡，
	 *   讀 `#primary-menu li a` 的 computed color）。 */
	html:not([data-theme="dark"]) button.klab-theme-toggle {
		color: #333;
	}
}

/* 選單項之間的分隔線：parent 用 `#eee`，在白底上很淡，換到深底就變成刺眼的白線。
 * ⚠ 只改**顏色**、不寫在 @media 裡 —— 桌機的 border-width 本來就是 0，
 *   改顏色沒有副作用；反過來寫進 @media 的話，parent 哪天改了斷點，
 *   白線會安靜地跑回來。 */
html[data-theme="dark"] .main-navigation ul.nav-menu,
html[data-theme="dark"] .main-navigation ul.nav-menu li a {
	border-color: var(--k-border);
}

/*--------------------------------------------------------------
# 側邊欄的小工具做成卡片（深淺兩種模式）
#
# 症狀：深色模式下每個小工具是一塊比頁面亮一點的方塊，文字上下左右都貼著
#   色塊邊緣，看起來像沒切乾淨的反白。
#
# ⚠⚠ 原因跟直覺相反：**那塊底色一直都在，只是原本看不見**。
#   parent 有 `body.single.lite-version #secondary .widget { background-color:#fff }`
#   （1,4,1），白底疊在白頁上等於沒有這個東西。深色模式把它換成 --k-surface
#   之後才第一次現形 —— 而它**從來沒有 padding**，因為原本不需要。
#   所以這不是深色模式做壞了，是把一個看不見的方塊變得看得見。
#   （量法：`getComputedStyle(widget).backgroundColor` 與 body 的比對，
#    淺色模式兩邊都是 rgb(255,255,255)。）
#
# ⚠ 只做 `#secondary`，不含頁尾的 `.footer-widgets-area` —— 頁尾本來就有自己的
#   深色底，套上卡片會變成深色疊深色。要改頁尾是另一件事，不要順手加進選擇器。
--------------------------------------------------------------*/

#secondary .widget {
	/* ⚠ border 一律留 1px（顏色由下面兩個模式給），不要只在某個模式加 ——
	   不然兩個模式的卡片寬度會差 2px，切換時整欄會抖一下。 */
	border: 1px solid transparent;
	border-radius: 10px;
	padding: 20px;
}

html:not([data-theme="dark"]) #secondary .widget {
	/* ⚠ 要 !important：parent 那條是 (1,4,1)，這裡只有 (1,2,1)。
	   不去湊更長的選擇器的理由同深色模式那一段 —— 對方的選擇器鏈
	   （body.single…、body.blog…、.lite-version…）會隨版本變，比特異度追不完。
	   ⚠ 這條寫 `:not([data-theme="dark"])` 而不是 `[data-theme="light"]`：
	   使用者沒選過的時候 <html> 上可能根本沒有這個屬性。 */
	background-color: #f7f8fa !important;
	border-color: #e5e8ec;
}

html[data-theme="dark"] #secondary .widget {
	/* 底色是上面「側邊欄與表單」那段給的 var(--k-surface)，這裡只補框 */
	border-color: var(--k-border);
}

/* ⚠ 只裝一個標題的小工具要退回「純標題」，不然會變成一個空框。
 *   會踩到是因為區塊小工具是**使用者在後台自己拆的** —— 例如「熱門標籤」的
 *   標題是一個區塊、標籤雲是另一個區塊，於是變成兩個 .widget。
 *   這種讓標題坐在頁面底色上，當成下面那張卡片的小標。
 * ⚙ 判斷方式：`:not(:has(> :not(h1)…:not(script):not(style)))`
 *   ＝「除了標題以外沒有別的子元素」。要一起排除 script／style／template：
 *   區塊小工具常常夾一段 inline script（廣告、區塊支援），
 *   它們 display:none 但**在 :has() 眼裡是元素**，會讓判斷失準。
 *   ⚠ 不支援 :has() 的舊瀏覽器會退回有框的樣子，醜但不會壞。
 * ⚠ 兩個模式各寫一次是為了**湊特異度**：上面深色那條是 (1,2,1) ＋ !important，
 *   只寫 `#secondary .widget:not(:has(…))`（1,1,1）蓋不掉它的底色。 */
html:not([data-theme="dark"]) #secondary .widget:not(:has(> :not(h1):not(h2):not(h3):not(h4):not(script):not(style):not(template))),
html[data-theme="dark"] #secondary .widget:not(:has(> :not(h1):not(h2):not(h3):not(h4):not(script):not(style):not(template))) {
	background-color: transparent !important;
	border: 0;
	border-radius: 0;
	padding: 0;
	/* 卡片之間是 30px；當小標時要靠近它說明的那張卡片 */
	margin-bottom: 10px;
}

/*--------------------------------------------------------------
# 頁首那一條（站名／副標）的底色
#
# 淺色模式那條灰不是哪個元素的 background —— 是 `.header-image > .overlay`
# 這層**黑色半透明**疊出來的（parent 給 opacity 0.3，從「額外 CSS」搬進來的
# `.second-design .overlay` 又蓋成 0.4）。0.4 的黑疊在白底上 = #999，
# 配白字對比只有 2.85：32px 的站名差一點（大字門檻 3.0），
# 16px 的副標差很多（內文門檻 4.5）。
#
# ⚠ 這裡調的是 **opacity 不是顏色** —— overlay 的用途是「壓暗使用者設的頁首圖」，
#   改成實色的話，哪天設了頁首圖就會被整片蓋掉。
# ⚠ 選擇器限定 `.header-image >`：`.overlay` 這個 class 在 parent 還用在
#   `#media-posts` 與 `.widget_keep_reading` 上，不要一起動到。
# ⚙ 0.55 → #737373 → 白字 4.74，站名與副標同時過 AA。
#
# ⚠⚠ 深色模式那條橫條是**四個元素疊出來的**：
#   `header#masthead`（整條）→ `.site-branding-container`（整條）
#   → `.header-image`（整條，overlay 的容器）→ `.site-branding-wrapper`
#   （**只有中間 1280px**，`@media (min-width:1024px)` 給了 max-width）。
#   只改前面幾個的話，**畫面中間那一段不會變**，而左右兩側會變 ——
#   看起來像「頁首左右各有一條淺色邊」，很難聯想到是漏了一個元素。
#   所以深色的顏色統一走 `--k-header`，不要在個別規則裡寫色碼。
#   （查法：`document.elementsFromPoint(x, y)` 把該點的整疊元素與各自的
#    background-color 列出來，比一條一條翻 CSS 快。）
--------------------------------------------------------------*/

html:not([data-theme="dark"]) .header-image > .overlay {
	opacity: 0.55;
}

/*--------------------------------------------------------------
# 目錄（ez-TOC）連結的 hover
#
# 症狀：滑過目錄的項目，**顏色完全不變**（深色 #99c5ff → #99c5ff、
#   淺色 #555 → #555）。站上其他每一種連結滑過去都會變色。
#
# ⚠ 它其實有一點回饋 —— hover 時會多一條底線（`text-decoration`），
#   所以不是「完全沒反應」。但只有底線、沒有變色，跟站上其他地方不一致，
#   而且**截圖與對比度掃描都看不出來**，要 forcePseudoState 或真的滑過去才知道。
#
# 站上的 hover 慣例（量出來的，不是猜的）：
#   深色 → #fff（內文、側邊欄、選單、上下篇都是）
#   淺色 → #e6432a 品牌紅（側邊欄、選單、上下篇；內文連結平常就是紅的，hover 轉黑）
#
# ⚠ 要 !important：上面 `li > a.ez-toc-link` 那兩條（從「額外 CSS」搬進來的
#   淺色 #555、以及深色的 var(--k-link)）都帶 !important，
#   hover 的特異度雖然比較高，但打不贏 !important。
--------------------------------------------------------------*/

/* ⚠⚠ 這裡**不能寫 `var(--k-accent)`** —— 那組變數整包定義在
   `html[data-theme="dark"] { … }` 裡面，淺色模式下根本沒有這個變數，
   宣告會在「計算值階段」失效，hover 就變成完全沒作用。
   ⚠ 而且不會有任何錯誤：CSS 沒有未定義變數的警告，devtools 上那條規則
   看起來好端端地寫著 —— 只有真的滑過去才知道沒反應。
   （`--k-accent` 的註解寫「深淺色共用」，指的是**色值**共用，不是變數在兩邊都有。） */
li > a.ez-toc-link:hover,
li > a.ez-toc-link:focus {
	color: #e6432a !important;
}

html[data-theme="dark"] li > a.ez-toc-link:hover,
html[data-theme="dark"] li > a.ez-toc-link:focus {
	color: #fff !important;
}

/*--------------------------------------------------------------
# 手機版標題橫幅底下的「往下滑」提示
#
# 為什麼要有：手機的 `#page-site-header` 高 348–456px，佔掉首屏 41–54%，
# 首屏上幾乎只看得到那張頁首圖 —— 使用者回報「有些人可能不會發現要往下滑才有文章」。
#
# ⚠⚠ 用 `::before`／`::after` 是**刻意的**，不是偷懶。
#   那段 HTML 在 parent 的 `single.php`／`page.php`／`archive.php`／`home.php`／
#   `search.php`／`404.php` **各寫了一次**，而且橫幅裡面**沒有任何 action hook**。
#   要塞真的元素只有兩條路：把七支樣板全複製進 child（以後 parent 一改就要手動追，
#   見上面「複製過來的模板會完全取代 parent 的」），或注一段 JS。
#   為了一個純裝飾的提示，兩個都太貴。
#   代價寫在這裡：**`content:` 裡的中文抽不出去翻譯、也選不起來**。
#   哪天要做多語系，這兩行要先搬進樣板。
#
# ⚠⚠ `z-index: 1` 不可以拿掉。`::before` 會被插成 `#page-site-header` 的
#   **第一個子元素**，排在 `.overlay`（`position:absolute`、40% 黑）**前面**，
#   沒有 z-index 的話那層黑會蓋在字上面。
#   ⚠ 症狀很難認：字還在、位置也對，**只是暗了一階** —— 截圖看不出來。
#   （`::after` 是最後一個子元素，本來就在上面，但兩個一起寫才不會日後改動時漏掉。）
#
# ⚠ 斷點用 1024px 是為了對齊 parent 的兩條規則，不是隨便挑的：
#   `@media (max-width:1024px)` 把橫幅 padding 加到 150px，
#   而 `@media (min-width:1025px)` 才把 `.wrapper` 設成 `position:absolute` 垂直置中。
#   桌機那邊內容被抽離文件流、橫幅固定 240px，這個提示塞不進去也不需要。
#
# ⚠ 整個提示是 `position:absolute`，**不會讓橫幅變高** —— 它坐在下 padding 裡。
# ⚠⚠ 但它**依賴下 padding 夠深**：文字在 `bottom: 56px`、箭號在 `bottom: 28px`，
#   所以下 padding 不能小於 ~72px，否則提示會壓到麵包屑上。
#   下面「手機版標題橫幅的高度」那一節的 `padding-bottom: 88px` 就是為了這個，
#   **要調高度時兩邊一起看**。
--------------------------------------------------------------*/

@media screen and (max-width: 1024px) {
	#page-site-header::before {
		content: "往下滑看內容";
		position: absolute;
		z-index: 1;
		/* ⚠⚠ `display: block` 不可以拿掉，而且**它才是讓字置中的關鍵**。
		   parent 有一條 clearfix：`.relative:before, .relative:after
		   { content:""; display:table; clear:both }`（style.css 2274），
		   而這個橫幅的 class 正是 `relative` —— 所以我們的偽元素預設是
		   **`display: table`**。絕對定位的 table box 是**縮到內容寬**，
		   `left:0; right:0` 撐不開它，字就會擠在左邊、貼著螢幕邊緣。
		   ⚠ 最難認的是：devtools 與 getComputedStyle 讀 `left`／`right`
		   都老實回報 `0px`，**看起來完全正確**，只有 `width` 會露餡
		   （84.25px ＝ 剛好六個字的寬度，不是 390px）。 */
		display: block;
		left: 0;
		right: 0;
		bottom: 56px;
		font-size: 13px;
		letter-spacing: 0.08em;
		line-height: 1;
		color: #fff;
		opacity: 0.85;
		/* 頁首圖是使用者自己換的，淺色照片上白字會糊；陰影是保險，不是裝飾 */
		text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
	}

	#page-site-header::after {
		content: "";
		position: absolute;
		z-index: 1;
		/* 同上那條 clearfix。這個箭號有寫死的 width／height，`display:table`
		   不會讓它跑掉，但留著 `block` 才不會日後改成自動寬時又踩一次。 */
		display: block;
		/* 12×12 的方塊轉 45°，只留右與下兩邊 = 一個朝下的箭號。
		   旋轉以中心為軸，所以 `margin-left` 用的還是未旋轉時的半寬。 */
		left: 50%;
		margin-left: -6px;
		bottom: 28px;
		width: 12px;
		height: 12px;
		border-right: 2px solid #fff;
		border-bottom: 2px solid #fff;
		/* ⚠ 這裡也要寫一次 rotate：動畫的每個 keyframe 都會整個換掉 transform，
		   少寫的話箭號在動畫跑起來的瞬間會轉回正方形。 */
		transform: rotate(45deg);
		animation: klab-scroll-cue 1.8s ease-in-out infinite;
	}

	@keyframes klab-scroll-cue {
		0%,
		100% {
			transform: translateY(0) rotate(45deg);
			opacity: 0.9;
		}
		50% {
			transform: translateY(7px) rotate(45deg);
			opacity: 0.35;
		}
	}

	/* ⚠ 這條是無障礙要求，不是加分項：會動的東西對前庭系統失調的人是實際傷害
	   （WCAG 2.3.3）。作業系統的「減少動態效果」打開時箭號要停下來，
	   但**不可以整個藏掉** —— 藏掉的話那些人就少了這個提示。 */
	@media (prefers-reduced-motion: reduce) {
		#page-site-header::after {
			animation: none;
			opacity: 0.9;
		}
	}
}

/*--------------------------------------------------------------
# 手機版標題橫幅的高度
#
# 問題：手機文章頁的 `#page-site-header` 高到 **530px，佔首屏 63%**
# （2026-09-12 實測，390×844，標題 3 行＋麵包屑 3 行），
# 首屏幾乎只看得到那張頁首圖。使用者兩次回報「太高」。
#
# ⚠ 原因是 parent 的兩條規則**只有一邊有斷點**：
#   `@media (max-width:1024px)` 把橫幅 padding 加到 **150px**（比桌機的 120px 還多），
#   而 `@media (min-width:1025px)` 才把 `.wrapper` 設成 `position:absolute` 垂直置中。
#   於是桌機是「內容抽離文件流 → 固定 240px」，
#   手機是「300px padding **再加上**標題與麵包屑的實際高度」——
#   標題越長橫幅越高，而長標題正是文章頁的常態。
#
# 做法：把桌機那套「內容垂直置中」搬到手機，但**用 flex 而不是絕對定位** ——
# 絕對定位的內容不佔高度，長標題會直接溢出橫幅；flex 會把橫幅撐開，
# 短的用 `min-height` 撐住，兩邊都不會壞。
#
# ⚠ `min-height: 348px` 不是隨便挑的：那是**首頁現在的高度**，
#   使用者明確說過首頁的高度沒問題。所以首頁維持 348px 一格沒動，
#   只有內容比較多的頁面（文章、分類）會從 530px 降到 ~358px（63% → 42%）。
#
# ⚠ `box-sizing: border-box` 不可以拿掉 —— 少了它，`min-height` 不含 padding，
#   短頁面會變成 348 + 128 = 476px，比改之前還高。
#
# ⚠ `.overlay` 與兩個偽元素都是 `position:absolute`，**不會變成 flex item**，
#   所以這個 flex 只影響 `.wrapper` 一個子元素。改完要實際量 `.wrapper` 的寬度與
#   置中有沒有跑掉（它靠 `margin:0 auto`，在 flex 裡是由 auto margin 吸收剩餘空間
#   來置中的，機制跟 block 不同）。
--------------------------------------------------------------*/

@media screen and (max-width: 1024px) {
	#page-site-header {
		box-sizing: border-box;
		min-height: 348px;
		/* 下 padding 比上面深，是留給「往下滑看內容」提示的位置，見上一節 */
		padding: 40px 0 88px;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}
}
