/*
Theme Name: DadiBlog MEOW
Theme URI: https://dadiblog.com
Author: dadi
Description: 簡潔排版 × 可愛橘色風格的個人部落格主題。版面參考 andyli.tw 的內容優先結構，配色與圓潤質感取自 Hexo MEOW 主題。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: dadiblog-meow
Tags: blog, clean, cute, responsive, dark-mode, right-sidebar
*/

/* ============================================================
   1. 設計 Token
   ============================================================ */
:root {
  --accent:        #FFB347;
  --accent-soft:   #FFD191;
  --accent-deep:   #E8912B;
  --accent-wash:   #FFF4E4;

  --bg:            #FBF8F4;
  --card:          #FFFFFF;
  --text:          #2F2A25;
  --text-strong:   #1C1815;
  --muted:         #8B8177;
  --border:        #EDE5DA;

  --radius-sm:  10px;
  --radius:     16px;
  --radius-lg:  22px;

  --shadow:       0 1px 3px rgba(47,42,37,.05), 0 6px 18px rgba(47,42,37,.045);
  --shadow-hover: 0 6px 14px rgba(232,145,43,.14), 0 14px 34px rgba(232,145,43,.12);
  --title-shadow: 1.5px 1.5px 0 rgba(47,42,37,.07);

  --maxw:    1180px;
  --maxw-rd: 760px;
  --nav-h:   64px;
  --gap:     28px;

  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system,
          BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-code: "SF Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;

  --ease: cubic-bezier(.22,.68,.36,1);
}

body[data-mode="dark"] {
  --accent:      #FFB347;
  --accent-soft: #FFD191;
  --accent-deep: #FFC470;
  --accent-wash: #3A2E20;

  --bg:          #1C1B1A;
  --card:        #262423;
  --text:        #E4DED6;
  --text-strong: #F5F1EB;
  --muted:       #968D83;
  --border:      #383430;

  --shadow:       0 1px 3px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.24);
  --shadow-hover: 0 6px 14px rgba(0,0,0,.34), 0 14px 34px rgba(255,179,71,.10);
  --title-shadow: 1.5px 1.5px 0 rgba(0,0,0,.28);
}

/* ============================================================
   2. Reset / 基礎
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .01em;
  transition: background .3s var(--ease), color .3s var(--ease);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-deep); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-strong);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .015em;
  margin: 0 0 .6em;
}

p { margin: 0 0 1.15em; }

code, pre { font-family: var(--font-code); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

::selection { background: var(--accent-soft); color: var(--text-strong); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ============================================================
   3. 導覽列
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 90;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow); }

.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 18px;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 1.12rem;
         color: var(--text-strong); letter-spacing: .02em; flex-shrink: 0; }
.brand:hover { color: var(--accent-deep); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 17px; line-height: 1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  box-shadow: 0 2px 8px rgba(232,145,43,.3);
}
.brand-tag { color: var(--muted); font-weight: 500; font-size: .8rem; letter-spacing: 0; }

.nav-menu { margin: 0 auto; padding: 0; list-style: none; display: flex; align-items: center; gap: 4px; }
.nav-menu li { position: relative; }
.nav-menu a {
  display: block; padding: 7px 14px; border-radius: 999px;
  color: var(--text); font-size: .93rem; font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-menu a:hover { background: var(--accent-wash); color: var(--accent-deep); }
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a { background: var(--accent); color: #fff; }

.nav-menu .sub-menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 168px;
  margin: 0; padding: 7px; list-style: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .22s var(--ease);
}
.nav-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu .sub-menu a { border-radius: var(--radius-sm); }

.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

.icon-btn {
  width: 38px; height: 38px; border: 1px solid var(--border); background: transparent;
  border-radius: 12px; cursor: pointer; color: var(--text);
  display: grid; place-items: center; font-size: 16px; line-height: 1; padding: 0;
  transition: all .2s var(--ease);
}
.icon-btn:hover { background: var(--accent-wash); border-color: var(--accent-soft); color: var(--accent-deep); transform: translateY(-1px); }

.nav-toggle { display: none; }

/* ============================================================
   4. 行動版側邊選單
   ============================================================ */
.mobile-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 82vw); z-index: 120;
  background: var(--card); border-left: 1px solid var(--border);
  padding: 24px 20px; overflow-y: auto;
  transform: translateX(100%); transition: transform .32s var(--ease);
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer ul { list-style: none; margin: 0; padding: 0; }
.mobile-drawer > ul > li > a,
.mobile-drawer .sub-menu a {
  display: block; padding: 11px 13px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 600;
}
.mobile-drawer a:hover { background: var(--accent-wash); color: var(--accent-deep); }
.mobile-drawer .sub-menu { padding-left: 14px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.drawer-head strong { font-size: 1.02rem; color: var(--text-strong); }

.scrim {
  position: fixed; inset: 0; z-index: 110; background: rgba(28,24,21,.42);
  opacity: 0; visibility: hidden; transition: all .3s var(--ease);
  backdrop-filter: blur(2px);
}
.scrim.is-open { opacity: 1; visibility: visible; }

/* ============================================================
   5. 搜尋覆蓋層
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0; z-index: 130;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: start center; padding-top: 16vh;
  opacity: 0; visibility: hidden; transition: all .28s var(--ease);
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay .search-box { width: min(620px, 90vw); }
.search-overlay-title {
  font-size: 1.5rem; margin-bottom: 18px; text-align: center;
  text-shadow: var(--title-shadow);
}
.search-form { display: flex; gap: 10px; }
.search-form input[type="search"] {
  flex: 1; padding: 15px 20px; font-size: 1rem; font-family: var(--font);
  color: var(--text); background: var(--card);
  border: 2px solid var(--border); border-radius: 999px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-form input[type="search"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash);
}
.search-form button {
  padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-family: var(--font);
  font-size: .95rem; transition: background .2s var(--ease), transform .2s var(--ease);
}
.search-form button:hover { background: var(--accent-deep); transform: translateY(-1px); }

/* ============================================================
   6. 主版面：內容 + 右側欄
   ============================================================ */
.site-main { padding: 40px 0 64px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 40px;
  align-items: start;
}
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); max-width: var(--maxw-rd); margin: 0 auto; }

/* ============================================================
   7. 頁首標題區
   ============================================================ */
.page-hero { margin-bottom: 30px; }
.page-hero h1 {
  font-size: clamp(1.5rem, 3.4vw, 2rem); margin-bottom: .3em;
  text-shadow: var(--title-shadow);
}
.page-hero h1 .accent { color: var(--accent-deep); }
.page-hero p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ============================================================
   8. 精選文章（andyli 的 featured post）
   ============================================================ */
.featured {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); margin-bottom: 34px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow); transition: all .3s var(--ease);
}
.featured:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.featured-media { position: relative; aspect-ratio: 21 / 9; overflow: hidden; background: var(--accent-wash); }
.featured-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.featured:hover .featured-media img { transform: scale(1.04); }
.featured-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,16,12,.82) 0%, rgba(20,16,12,.25) 46%, transparent 72%);
}
.featured-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 30px; z-index: 2; }
.featured-body h2 {
  color: #fff; font-size: clamp(1.15rem, 2.5vw, 1.66rem);
  margin: 8px 0 6px; text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.featured-body .excerpt { color: rgba(255,255,255,.86); font-size: .93rem; margin: 0;
                          display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured-body .meta { color: rgba(255,255,255,.8); }
.featured.no-image .featured-media { aspect-ratio: auto; height: 0; }
.featured.no-image .featured-body { position: static; padding: 28px 30px; }
.featured.no-image .featured-body h2 { color: var(--text-strong); text-shadow: var(--title-shadow); }
.featured.no-image .featured-body .excerpt,
.featured.no-image .featured-body .meta { color: var(--muted); }

/* ============================================================
   9. 文章卡片格線
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--gap); }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--accent-soft); }

.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--accent-wash); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-media.placeholder {
  display: grid; place-items: center; font-size: 2.4rem;
  background: linear-gradient(135deg, var(--accent-wash) 0%, color-mix(in srgb, var(--accent-soft) 45%, var(--card)) 100%);
}

.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  background: var(--accent-wash); color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent-soft) 55%, transparent);
  transition: all .2s var(--ease);
}
a.chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.sticky-flag { background: var(--accent); color: #fff; border-color: var(--accent); }

.card-title { font-size: 1.12rem; margin: 0 0 9px; line-height: 1.45; }
.card-title a { color: var(--text-strong); }
.card-title a:hover { color: var(--accent-deep); }

.excerpt { color: var(--muted); font-size: .9rem; line-height: 1.75; margin: 0 0 16px;
           display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
        color: var(--muted); font-size: .8rem; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }

.card-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between;
             align-items: center; border-top: 1px dashed var(--border); }
.read-more { font-size: .85rem; font-weight: 700; color: var(--accent-deep); display: inline-flex; align-items: center; gap: 4px; }
.read-more:hover { gap: 9px; }
.read-more::after { content: "→"; transition: transform .2s var(--ease); }

/* ============================================================
   10. 側邊欄
   ============================================================ */
.sidebar { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 20px; }

.side-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.side-card h3 {
  font-size: .95rem; margin: 0 0 14px; padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 7px;
}
.side-card h3::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--accent); }

.profile { text-align: center; }
.profile-avatar {
  width: 82px; height: 82px; border-radius: 50%; margin: 2px auto 12px;
  display: grid; place-items: center; font-size: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  box-shadow: 0 4px 16px rgba(232,145,43,.28);
  border: 3px solid var(--card);
}
.profile-name { font-size: 1.05rem; font-weight: 800; color: var(--text-strong); margin: 0 0 5px; }
.profile-bio { font-size: .86rem; color: var(--muted); margin: 0 0 15px; line-height: 1.7; }

.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.stat-num { display: block; font-size: 1.15rem; font-weight: 900; color: var(--accent-deep); line-height: 1.3; }
.stat-label { font-size: .74rem; color: var(--muted); }

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { margin-bottom: 2px; }
.side-list li:last-child { margin-bottom: 0; }
.side-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--text); font-size: .88rem; font-weight: 500;
  transition: all .2s var(--ease);
}
.side-list a:hover { background: var(--accent-wash); color: var(--accent-deep); transform: translateX(3px); }
.side-list .count {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 1px 9px; flex-shrink: 0;
}
.side-list .children { list-style: none; padding-left: 14px; margin: 2px 0 0; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a {
  font-size: .8rem !important; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-wash); color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent-soft) 50%, transparent);
  transition: all .2s var(--ease);
}
.tag-cloud a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

.side-post { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.side-post:last-child { border-bottom: 0; }
.side-post-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden;
                   flex-shrink: 0; background: var(--accent-wash); display: grid; place-items: center; font-size: 20px; }
.side-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-post-title { font-size: .86rem; font-weight: 600; line-height: 1.5; margin: 0 0 3px; }
.side-post-title a { color: var(--text); }
.side-post-title a:hover { color: var(--accent-deep); }
.side-post-date { font-size: .74rem; color: var(--muted); }

/* ============================================================
   11. 單篇文章
   ============================================================ */
.entry {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 34px 38px 40px; overflow: hidden;
}
.entry-header { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.entry-title { font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin: 10px 0 12px; text-shadow: var(--title-shadow); }
.entry-cover { margin: 0 0 26px; border-radius: var(--radius); overflow: hidden; }

.entry-content { font-size: 1.02rem; line-height: 1.95; }
.entry-content h2 {
  font-size: 1.4rem; margin: 2em 0 .75em; padding-left: 13px;
  border-left: 5px solid var(--accent); border-radius: 2px;
}
.entry-content h3 { font-size: 1.18rem; margin: 1.7em 0 .65em; }
.entry-content h4 { font-size: 1.04rem; margin: 1.5em 0 .6em; }
.entry-content img { border-radius: var(--radius); margin: 1.6em auto; box-shadow: var(--shadow); }
.entry-content ul, .entry-content ol { padding-left: 1.5em; margin: 0 0 1.3em; }
.entry-content li { margin-bottom: .5em; }
.entry-content li::marker { color: var(--accent-deep); font-weight: 700; }

.entry-content blockquote {
  margin: 1.7em 0; padding: 16px 22px;
  background: var(--accent-wash); border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--text);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content :not(pre) > code {
  background: var(--accent-wash); color: var(--accent-deep);
  padding: 2px 7px; border-radius: 6px; font-size: .88em;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 40%, transparent);
}
.entry-content pre {
  background: #2D2D2D; color: #CCC; padding: 18px 20px;
  border-radius: var(--radius); overflow-x: auto; line-height: 1.7;
  font-size: .88rem; margin: 1.6em 0;
}
.entry-content pre code { background: none; border: 0; color: inherit; padding: 0; }

.entry-content table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .93rem; }
.entry-content th, .entry-content td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.entry-content th { background: var(--accent-wash); color: var(--text-strong); font-weight: 700; }

.entry-content a { border-bottom: 1.5px solid var(--accent-soft); }
.entry-content a:hover { border-bottom-color: var(--accent); background: var(--accent-wash); }

.entry-footer { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--border); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.post-nav a {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 18px; box-shadow: var(--shadow); transition: all .25s var(--ease);
}
.post-nav a:hover { border-color: var(--accent-soft); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.post-nav .dir { display: block; font-size: .76rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.post-nav .t { font-size: .93rem; font-weight: 700; color: var(--text-strong); line-height: 1.5;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav .next { text-align: right; }

/* 目錄 */
.toc-card .toc-list { list-style: none; margin: 0; padding: 0; font-size: .85rem; max-height: 52vh; overflow-y: auto; }
.toc-card .toc-list a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--muted); line-height: 1.55; }
.toc-card .toc-list a:hover { background: var(--accent-wash); color: var(--accent-deep); }
.toc-card .toc-list a.is-active { background: var(--accent-wash); color: var(--accent-deep); font-weight: 700; }
.toc-card .toc-h3 { padding-left: 20px !important; font-size: .95em; }

/* 留言 */
.comments-area { margin-top: 30px; background: var(--card); border: 1px solid var(--border);
                 border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px 32px; }
.comments-area h3 { font-size: 1.1rem; margin-bottom: 18px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.comment-form input[type=text], .comment-form input[type=email],
.comment-form input[type=url], .comment-form textarea {
  width: 100%; padding: 11px 15px; font-family: var(--font); font-size: .93rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form .submit {
  padding: 11px 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-family: var(--font);
}
.comment-form .submit:hover { background: var(--accent-deep); }

/* ============================================================
   12. 分頁
   ============================================================ */
.pagination { margin-top: 38px; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.pagination .page-numbers {
  min-width: 40px; height: 40px; padding: 0 13px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: .9rem; font-weight: 600;
  transition: all .2s var(--ease);
}
.pagination a.page-numbers:hover { background: var(--accent-wash); border-color: var(--accent-soft); color: var(--accent-deep); transform: translateY(-2px); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .dots { border: 0; background: none; }

/* ============================================================
   13. 空狀態 / 404
   ============================================================ */
.empty-state { text-align: center; padding: 60px 24px; background: var(--card);
               border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.empty-emoji { font-size: 3.6rem; margin-bottom: 14px; line-height: 1; }
.empty-state h2 { font-size: 1.3rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.btn {
  display: inline-block; padding: 11px 26px; border-radius: 999px;
  background: var(--accent); color: #fff !important; font-weight: 700; font-size: .92rem;
  transition: all .2s var(--ease); border: 0; cursor: pointer;
}
.btn:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ============================================================
   14. 頁尾
   ============================================================ */
.site-footer {
  margin-top: 50px; padding: 34px 0; text-align: center;
  background: var(--card); border-top: 1px solid var(--border);
  color: var(--muted); font-size: .87rem;
}
.footer-brand { font-weight: 800; color: var(--text-strong); margin-bottom: 7px; font-size: 1rem; }
.site-footer p { margin: 0 0 5px; }
.site-footer a { color: var(--accent-deep); }

/* 回到頂端 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 17px;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all .28s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   15. 響應式
   ============================================================ */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: static; grid-template-columns: repeat(2,1fr); }
  .side-card.toc-card { display: none; }
}

@media (max-width: 860px) {
  .nav-menu { display: none; }
  .nav-toggle { display: grid; }
  .brand-tag { display: none; }
  .post-grid { grid-template-columns: minmax(0,1fr); }
  .sidebar { grid-template-columns: minmax(0,1fr); }
  .entry { padding: 26px 22px 30px; border-radius: var(--radius); }
  .comments-area { padding: 22px 20px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .site-main { padding: 28px 0 46px; }
  .featured-body { padding: 20px 22px; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .to-top { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
