:root {
  --bg:#fff; --fg:#1a1f2e; --muted:#6b7280; --line:#e5e7eb;
  --accent:#3b82f6;
  --accent-2:#8b5cf6;
  --accent-grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  --soft-bg:#f8fafc;
  --max-w: 1140px;
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --radius: 14px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.05), 0 4px 20px rgba(15,23,42,.04);
  --shadow-hover: 0 4px 6px rgba(0,0,0,.05), 0 20px 40px rgba(59,130,246,.12);
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body { font-family: var(--font); color: var(--fg); background: var(--bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; transition: all .2s ease; }
a:hover { color: #2563eb; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ==== Site header ==== */
.site-header { background:#fff; border-bottom:1px solid var(--line); padding:1rem 0; position:sticky; top:0; z-index:100; backdrop-filter: blur(12px); background: rgba(255,255,255,.85); }
.site-header .container { display:flex; align-items:center; gap:1.5rem; flex-wrap:wrap; }
.site-brand { font-size:1.5rem; font-weight:700; color:var(--fg); letter-spacing:.5px; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.site-tagline { color: var(--muted); font-size:0.9rem; }
.site-nav { margin-left:auto; display:flex; gap:1.75rem; }
.site-nav a { color: var(--fg); font-weight:500; position: relative; padding: .25rem 0; }
.site-nav a:hover { color: var(--accent); }
.site-nav a::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--accent-grad); transform: scaleX(0); transition: transform .2s; }
.site-nav a:hover::after { transform: scaleX(1); }

/* ==== Hero ==== */
.hero { padding: 5rem 1.5rem 4.5rem; text-align: center; position: relative; overflow: hidden; }
.hero-gradient { background: var(--accent-grad); color: #fff; }
.hero-gradient::before { content:''; position:absolute; inset:0; background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.15), transparent 50%), radial-gradient(circle at 80% 70%, rgba(255,255,255,.1), transparent 50%); }
.hero-inner { position: relative; z-index: 1; max-width: var(--max-w); margin: 0 auto; }
.hero-title { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 1rem; font-weight: 700; letter-spacing: 1px; text-shadow: 0 2px 20px rgba(0,0,0,.1); }
.hero-tagline { color: rgba(255,255,255,.92); font-size: clamp(1rem, 2vw, 1.3rem); margin-bottom: 2.5rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-hero { display: inline-block; padding: .8rem 1.8rem; border-radius: 50px; font-weight: 600; transition: all .25s; cursor: pointer; border: none; font-size: 1rem; }
.btn-hero-primary { background: #fff; color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.2); color: #2563eb; }
.btn-hero-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-hero-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; color: #fff; }
section + section .btn-hero-outline { color: var(--accent); border-color: var(--accent); }
section + section .btn-hero-outline:hover { background: var(--accent); color: #fff; }

/* ==== Page banner (for /blog, /category, /tag, /post) ==== */
.page-banner { background: var(--accent-grad); color: #fff; padding: 3.5rem 1.5rem 3rem; text-align: center; margin-bottom: 0; }
.page-banner-inner { max-width: var(--max-w); margin: 0 auto; }
.page-banner h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .5rem 0; font-weight: 700; line-height: 1.3; }
.page-banner p { color: rgba(255,255,255,.85); margin: 0; font-size: .95rem; }

/* ==== Section title ==== */
.section-title { text-align: center; font-size: 1.8rem; margin: 3.5rem 0 2rem; position: relative; }
.section-title span { display: inline-block; padding: 0 1.5rem; background: #fff; position: relative; z-index: 1; }
.section-title::before { content:''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); z-index: 0; }

/* ==== Featured section ==== */
.featured-section { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.featured-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 4rem; }
.featured-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); transition: all .3s; border: 1px solid var(--line); }
.featured-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.featured-thumb { height: 240px; background: var(--accent-grad); }
.featured-body { padding: 2rem; }
.featured-body h3 { font-size: 1.8rem; margin: .75rem 0; line-height: 1.3; }
.featured-body h3 a { color: var(--fg); }
.featured-body h3 a:hover { color: var(--accent); }
.featured-body .post-excerpt { color: var(--muted); margin: .5rem 0 1rem; }

.read-more { display: inline-block; margin-top: .5rem; font-weight: 600; color: var(--accent); }
.read-more:hover { transform: translateX(4px); display: inline-block; }

/* ==== Post grid (cards) ==== */
.post-grid-section, .blog-section { max-width: var(--max-w); margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.post-card-v2 { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); border: 1px solid var(--line); transition: all .25s; }
.post-card-v2:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(59,130,246,.3); }
.post-card-body { padding: 1.5rem; }
.post-card-body h3 { font-size: 1.15rem; margin: .5rem 0 .5rem; line-height: 1.4; }
.post-card-body h3 a { color: var(--fg); }
.post-card-body h3 a:hover { color: var(--accent); }
.post-meta { color: var(--muted); font-size: .85rem; margin: .25rem 0; }
.post-excerpt { color: var(--muted); margin: .75rem 0 0; font-size: .9rem; line-height: 1.5; }

/* Category badges */
.post-categories { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.cat-badge { display: inline-block; padding: .15rem .7rem; background: linear-gradient(135deg, rgba(59,130,246,.1), rgba(139,92,246,.1)); color: var(--accent); border-radius: 100px; font-size: .75rem; font-weight: 600; }
.cat-badge:hover { background: var(--accent-grad); color: #fff; }
.cat-badge-light { background: rgba(255,255,255,.2); color: #fff; }
.cat-badge-light:hover { background: rgba(255,255,255,.35); color: #fff; }

.see-more { text-align: center; margin: 2.5rem 0 4rem; }

/* ==== Blog filter ==== */
.blog-toolbar { margin: 0 0 2rem; }
.filter-input { width: 100%; padding: .9rem 1.2rem; border: 1px solid var(--line); border-radius: 50px; font-size: 1rem; transition: all .2s; }
.filter-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(59,130,246,.1); }

/* ==== Post detail ==== */
.post-detail-v2 { max-width: 800px; margin: -1px auto 0; padding: 3rem 1.5rem; background: #fff; }
.post-body { font-size: 1.1rem; line-height: 1.85; }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.5rem 0; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.post-body pre { background: #1f2937; color: #f3f4f6; padding: 1.2rem; border-radius: 10px; overflow-x: auto; font-size: .9em; }
.post-body code { background: rgba(59,130,246,.08); padding: .15em .45em; border-radius: 4px; font-size: .95em; color: var(--accent); }
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body blockquote { border-left: 4px solid var(--accent); margin: 1.5em 0; padding: .75em 1.5em; background: var(--soft-bg); border-radius: 0 8px 8px 0; color: var(--fg); font-style: italic; }
.post-body h2, .post-body h3 { margin-top: 2.5rem; }
.post-body h2 { font-size: 1.6rem; }
.post-body h3 { font-size: 1.3rem; }
.post-body a { font-weight: 500; border-bottom: 1px solid transparent; }
.post-body a:hover { border-color: var(--accent); }
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-body li { margin: .35em 0; }

.post-tags { margin-top: 3rem; padding-top: 1.5rem; border-top:1px solid var(--line); }
.tag-pill { display: inline-block; padding: .25rem .8rem; border-radius: 100px; background: var(--soft-bg); color: var(--muted); font-size: .85rem; margin-right: .5rem; }
.tag-pill:hover { background: var(--accent); color: #fff; }

.post-footer-cta { margin-top: 3rem; text-align: center; }

/* ==== Pagination ==== */
.pagination { display:flex; gap:.5rem; margin: 3rem 0; justify-content:center; flex-wrap: wrap; }
.page-link { padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 8px; color: var(--fg); font-weight: 500; transition: all .15s; }
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.current { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* ==== 404 ==== */
.error-page { text-align:center; padding: 6rem 1rem; }
.error-page h1 { font-size: 7rem; margin: 0; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; }
.error-page p { color: var(--muted); margin: 1rem 0 2rem; }

/* ==== Site footer ==== */
.site-footer { border-top:1px solid var(--line); margin-top: 4rem; padding: 3rem 0 2rem; color: var(--muted); background: var(--soft-bg); font-size: 0.9rem; }
.site-footer .container { text-align: center; }
.site-footer .social-links { margin-bottom: 1.25rem; display:flex; gap: 1.5rem; justify-content:center; flex-wrap:wrap; }
.site-footer .social-links a { color: var(--muted); font-weight:500; padding: .25rem .75rem; border-radius: 100px; transition: all .2s; }
.site-footer .social-links a:hover { color: var(--accent); background: rgba(59,130,246,.1); }
.site-footer .contact-info { margin-bottom: 1.25rem; display:flex; gap: 1.5rem; justify-content:center; flex-wrap:wrap; font-size:.9rem; }
.site-footer .contact-info a { color: var(--muted); }
.site-footer p { margin: 0; opacity: .75; }

@media (max-width: 768px) {
  .site-header .container { gap: .75rem; }
  .site-nav { margin-left: 0; width: 100%; gap: 1rem; }
  .hero { padding: 3rem 1rem; }
  .post-grid { grid-template-columns: 1fr; }
  .featured-body { padding: 1.5rem; }
}

/* ==== Archive page (author / date / category) — Astra-like ==== */
.archive-hero { background: linear-gradient(135deg, #f5f7fa 0%, #eef1f7 100%); padding: 3rem 1.5rem 2.5rem; text-align: center; border-bottom: 1px solid var(--line); position: relative; }
.archive-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent-grad); }
.archive-hero-inner { max-width: 760px; margin: 0 auto; }
.archive-avatar { width: 88px; height: 88px; border-radius: 50%; background: var(--accent-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 700; margin: 0 auto 1rem; box-shadow: 0 8px 24px rgba(59,130,246,.25); }
.archive-kicker { color: var(--muted); font-size: .85rem; margin: 0 0 .25rem; letter-spacing: 2px; text-transform: uppercase; }
.archive-title { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; margin: .25rem 0 .75rem; color: var(--fg); }
.archive-stats { color: var(--muted); font-size: .9rem; margin: 0; }

.archive-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; padding: 3rem 1.5rem; max-width: var(--max-w); margin: 0 auto; }
@media (max-width: 860px) { .archive-wrap { grid-template-columns: 1fr; } }

.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.75rem; }
.empty-archive { padding: 4rem 2rem; text-align: center; color: var(--muted); background: var(--soft-bg); border-radius: var(--radius); }

.ast-post-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); border: 1px solid var(--line); display: flex; flex-direction: column; transition: all .25s; }
.ast-post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: rgba(59,130,246,.3); }
.ast-post-thumb { display: block; height: 200px; background-color: #f3f4f6; background-size: cover; background-position: center; }
.ast-post-thumb-placeholder { background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 50%, #fce7f3 100%); }
.ast-post-body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.ast-post-cats { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.ast-cat-link { font-size: .72rem; color: var(--accent); font-weight: 600; padding: .12rem .55rem; background: rgba(59,130,246,.08); border-radius: 100px; text-transform: uppercase; letter-spacing: .5px; }
.ast-cat-link:hover { background: var(--accent); color: #fff; }
.ast-post-title { font-size: 1.05rem; margin: .25rem 0 .55rem; line-height: 1.45; font-weight: 600; }
.ast-post-title a { color: var(--fg); }
.ast-post-title a:hover { color: var(--accent); }
.ast-post-excerpt { color: var(--muted); font-size: .85rem; margin: .15rem 0 .75rem; line-height: 1.55; flex: 1; }
.ast-read-more { color: var(--accent); font-size: .85rem; font-weight: 600; align-self: flex-start; padding: .1rem 0; }
.ast-read-more:hover { transform: translateX(3px); display: inline-block; }
.ast-post-meta { color: var(--muted); font-size: .78rem; margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ast-author { color: var(--accent); font-weight: 500; }
.ast-author:hover { text-decoration: underline; }
.ast-sep { color: var(--line); }

.archive-sidebar { display: flex; flex-direction: column; gap: 1.75rem; }
.ast-widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-card); }
.ast-widget-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 700; padding-bottom: .6rem; border-bottom: 2px solid var(--accent); display: inline-block; }
.ast-search-form { display: flex; gap: .4rem; }
.ast-search-form input { flex: 1; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 6px; font-size: .9rem; }
.ast-search-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.ast-search-form button { padding: .5rem .8rem; background: var(--accent-grad); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.ast-recent-list, .ast-authors-list, .ast-months-list { list-style: none; padding: 0; margin: 0; }
.ast-recent-list li, .ast-authors-list li, .ast-months-list li { padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; line-height: 1.45; }
.ast-recent-list li:last-child, .ast-authors-list li:last-child, .ast-months-list li:last-child { border-bottom: none; }
.ast-recent-list a, .ast-authors-list a, .ast-months-list a { color: var(--fg); display: block; }
.ast-recent-list a:hover, .ast-authors-list a:hover, .ast-months-list a:hover { color: var(--accent); padding-left: 4px; }

/* ============================================================== */
/* ==== v2.16: 統一 Astra 風格 header / footer / post detail ==== */
/* ============================================================== */

/* override the old white site-header — hide it in case it's still rendered */
.site-header { display: none; }

/* ===== Header ===== */
.ch-site-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid #eef0f4; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.ch-header-inner { max-width: 1200px; margin: 0 auto; padding: .9rem 1.5rem; display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.ch-brand { display: inline-flex; align-items: center; text-decoration: none; }
.ch-brand-logo { height: 46px; width: auto; display: block; }
@media (max-width: 640px) { .ch-brand-logo { height: 36px; } }

.ch-nav { margin-left: auto; }
.ch-nav-list { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; align-items: center; }
.ch-nav-list > li > a { display: block; padding: .75rem 1rem; color: #1f2937; font-size: .95rem; font-weight: 500; text-decoration: none; border-radius: 6px; transition: all .15s; }
.ch-nav-list > li > a:hover { color: #3b82f6; background: #f3f6fa; }
.ch-nav-list > li.ch-nav-dropdown { position: relative; }
.ch-nav-list > li.ch-nav-dropdown > a .caret { font-size: .7em; margin-left: 4px; opacity: .6; }
.ch-nav-submenu { position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid #eef0f4; border-radius: 10px; box-shadow: 0 12px 36px rgba(15,23,42,.12); padding: .5rem; list-style: none; margin: 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s; }
.ch-nav-dropdown:hover .ch-nav-submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.ch-nav-submenu li a { display: block; padding: .55rem .85rem; color: #1f2937; font-size: .88rem; text-decoration: none; border-radius: 6px; }
.ch-nav-submenu li a:hover { background: #eff6ff; color: #3b82f6; }
.ch-nav-search a { display: inline-flex; padding: .55rem; color: #6b7280; border-radius: 50%; }
.ch-nav-search a:hover { color: #3b82f6; background: #f3f6fa; }

.ch-search-bar { display: flex; gap: .5rem; padding: 1rem 1.5rem; background: #f8fafc; border-top: 1px solid #eef0f4; max-width: 1200px; margin: 0 auto; }
.ch-search-bar input { flex: 1; padding: .7rem 1rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; }
.ch-search-bar button { padding: .7rem 1.2rem; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.ch-search-bar button[type=submit] { background: linear-gradient(135deg,#3b82f6,#6366f1); color: #fff; }
.ch-search-bar button[type=button] { background: #e5e7eb; color: #374151; }

@media (max-width: 900px) {
  .ch-nav-list { flex-wrap: wrap; }
  .ch-nav-list > li > a { padding: .6rem .75rem; font-size: .9rem; }
}

/* ===== Main wrapper override (replace .container padding) ===== */
.ch-main { min-height: calc(100vh - 200px); }
.ch-main > * { max-width: none; }

/* ===== Footer ===== */
.ch-site-footer { background: #1f2937; color: #d1d5db; margin-top: 4rem; }
.ch-footer-inner { max-width: 1200px; margin: 0 auto; padding: 3.5rem 1.5rem 2.5rem; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr; gap: 2.5rem; }
@media (max-width: 860px) { .ch-footer-inner { grid-template-columns: 1fr 1fr; } .ch-footer-brand { grid-column: 1 / -1; } }
@media (max-width: 500px) { .ch-footer-inner { grid-template-columns: 1fr; } }
.ch-footer-brand { display: flex; align-items: center; gap: .8rem; }
.ch-footer-brand .ch-brand-mark { background: linear-gradient(135deg,#3b82f6,#6366f1); }
.ch-footer-brand strong { display: block; color: #fff; font-size: 1.2rem; }
.ch-footer-brand small { color: #9ca3af; font-size: .7rem; letter-spacing: 3px; }
.ch-footer-nav h4, .ch-footer-contact h4 { color: #fff; font-size: .95rem; margin: 0 0 1rem; }
.ch-footer-nav ul { list-style: none; padding: 0; margin: 0; }
.ch-footer-nav li { margin-bottom: .55rem; }
.ch-footer-nav a, .ch-footer-contact a { color: #d1d5db; text-decoration: none; font-size: .88rem; }
.ch-footer-nav a:hover, .ch-footer-contact a:hover { color: #93c5fd; }
.ch-footer-contact p { margin: .35rem 0; font-size: .88rem; color: #d1d5db; }
.ch-footer-bottom { border-top: 1px solid #374151; padding: 1.5rem; text-align: center; font-size: .82rem; color: #9ca3af; }

/* ===== Post detail (cloudflare-dlp style) ===== */
.ch-post-banner { background: linear-gradient(135deg, #1e3a8a 0%, #312e81 50%, #4c1d95 100%); color: #fff; padding: 4rem 1.5rem 3.5rem; position: relative; overflow: hidden; }
.ch-post-banner::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.08), transparent 50%), radial-gradient(circle at 80% 70%, rgba(255,255,255,.06), transparent 50%); pointer-events: none; }
.ch-post-banner-inner { max-width: 920px; margin: 0 auto; position: relative; z-index: 1; }
.ch-post-cats { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.ch-post-cat { display: inline-block; padding: .25rem .8rem; background: rgba(255,255,255,.18); color: #fff; border-radius: 100px; font-size: .78rem; font-weight: 600; text-decoration: none; transition: all .2s; }
.ch-post-cat:hover { background: #fff; color: #1e3a8a; }
.ch-post-title { font-size: clamp(1.5rem, 3.2vw, 2.4rem); margin: 0 0 1.2rem; line-height: 1.35; font-weight: 700; }
.ch-post-meta { display: flex; gap: 1.5rem; align-items: center; color: rgba(255,255,255,.85); font-size: .88rem; flex-wrap: wrap; }
.ch-post-meta a { color: #fff; text-decoration: none; }
.ch-post-meta a:hover { text-decoration: underline; }

.ch-post-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem; }
@media (max-width: 860px) { .ch-post-wrap { grid-template-columns: 1fr; } }
.ch-post-main { background: #fff; }
.ch-post-thumbnail { width: 100%; max-height: 480px; object-fit: cover; border-radius: 12px; margin-bottom: 2rem; box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.ch-post-body { font-size: 1rem; line-height: 1.85; color: #1f2937; }
.ch-post-body h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; padding-left: 1rem; border-left: 5px solid #3b82f6; color: #1e3a8a; }
.ch-post-body h3 { font-size: 1.25rem; margin: 2rem 0 .9rem; color: #1f2937; }
.ch-post-body p { margin: 1rem 0; }
.ch-post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.5rem 0; }
.ch-post-body a { color: #3b82f6; text-decoration: underline; }
.ch-post-body a:hover { color: #1e3a8a; }
.ch-post-body ul, .ch-post-body ol { padding-left: 1.5rem; margin: 1rem 0; }
.ch-post-body li { margin: .35rem 0; }
.ch-post-body blockquote { border-left: 4px solid #d1d5db; padding: .8rem 1.2rem; margin: 1.5rem 0; background: #f9fafb; color: #4b5563; font-style: italic; }
.ch-post-body code { background: #f3f4f6; padding: .15rem .45rem; border-radius: 4px; font-size: .9em; color: #be185d; }
.ch-post-body pre { background: #1f2937; color: #f9fafb; padding: 1rem 1.2rem; border-radius: 8px; overflow-x: auto; }
.ch-post-body pre code { background: transparent; color: inherit; padding: 0; }

.ch-post-tags { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #e5e7eb; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ch-post-tags-label { color: #6b7280; font-size: .9rem; margin-right: .5rem; }
.ch-post-tag { display: inline-block; padding: .25rem .8rem; background: #f3f4f6; color: #3b82f6; border-radius: 100px; font-size: .82rem; text-decoration: none; }
.ch-post-tag:hover { background: #3b82f6; color: #fff; }

.ch-post-back { display: inline-block; margin-top: 2.5rem; padding: .7rem 1.5rem; border: 2px solid #3b82f6; color: #3b82f6; border-radius: 30px; text-decoration: none; font-weight: 600; transition: all .2s; }
.ch-post-back:hover { background: #3b82f6; color: #fff; }


/* === v2.17 TOC (文章大綱) === */
.ch-toc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin: 0 0 2rem;
  font-size: .95rem;
}
.ch-toc-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 .6rem; padding: 0;
}
.ch-toc-title { font-weight: 700; color: #0f172a; font-size: 1.05rem; }
.ch-toc-toggle {
  background: transparent; border: 1px solid #cbd5e1; color: #475569;
  font-size: .85rem; padding: .15rem .55rem; border-radius: 4px; cursor: pointer;
}
.ch-toc-toggle:hover { background: #e2e8f0; }
.ch-toc-list { list-style: none; margin: 0; padding: 0; counter-reset: tocsec; }
.ch-toc-list > li {
  counter-increment: tocsec;
  margin: .35rem 0;
}
.ch-toc-list > li::before {
  content: counter(tocsec) ". ";
  color: #64748b;
  font-weight: 600;
}
.ch-toc-list ol { list-style: none; padding-left: 1.6rem; counter-reset: tocsub; margin: .25rem 0; }
.ch-toc-list ol > li {
  counter-increment: tocsub;
  margin: .2rem 0;
}
.ch-toc-list ol > li::before {
  content: counter(tocsec) "." counter(tocsub) ". ";
  color: #94a3b8;
}
.ch-toc a { color: #1e293b; text-decoration: none; }
.ch-toc a:hover { color: #2563eb; text-decoration: underline; }
.ch-toc.collapsed .ch-toc-list { display: none; }

/* anchor offset for fixed-ish header (not strictly fixed, but keep room) */
.ch-post-body h2[id], .ch-post-body h3[id] { scroll-margin-top: 80px; }

/* === 科腦好物 跨站連結（由購物站串接加入） === */
.ch-nav-list > li.ch-nav-shop > a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-left: .5rem;
  padding: .45rem .9rem;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 4px 14px rgba(59,130,246,.25);
}
.ch-nav-list > li.ch-nav-shop > a:hover {
  color: #fff;
  filter: brightness(1.06);
  background: var(--accent-grad);
}
.ch-nav-list > li.ch-nav-shop > a::after { content: none; }
.ch-shop-logo {
  height: 22px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 6px;
  padding: 2px 3px;
}
.ch-nav-shop .ch-ext { font-size: .8em; opacity: .9; }
