:root {
    --page-bg: #f2f0ea;
    --paper: #fbf9f4;
    --paper-soft: #f3eee5;
    --sidebar-bg: #f3eee5;
    --ink: #023e47;
    --muted: #097889;
    --accent: #7a5e2f;
    --accent-dark: #7a5e2f;
    --line: rgba(84, 67, 52, 0.17);
    --shadow: 0 12px 32px rgba(68, 52, 38, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
    font-size: 19px;
    line-height: 1.85;
}

a { color: var(--accent-dark); }

.site-header {
    max-width: 1180px;
    margin: 32px auto 0;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.site-branding { padding: 44px 52px 32px; }
.site-title { margin: 0; font-size: clamp(30px, 4vw, 46px); font-weight: 500; letter-spacing: .04em; line-height: 1.3; }
.site-title a { color: var(--ink); text-decoration: none; }
.site-description { max-width: 780px; margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 0 38px;
    background: var(--paper-soft);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.site-nav a { padding: 16px 15px; color: var(--ink); font-size: 16px; text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent); background: rgba(255, 255, 255, .58); }

.sidebar-column { align-self: start; display: grid; gap: 18px; min-width: 0; }
.site-search { width: 100%; padding: 22px 20px 18px; background: var(--paper-soft); }
.site-search > label { display: block; margin-bottom: 6px; color: var(--ink); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 14px; }
.search-row { display: flex; width: 100%; }
.search-row input { flex: 1; min-width: 0; padding: 10px 13px; border: 1px solid rgba(2, 62, 71, .25); border-right: 0; background: #fffdf9; color: var(--ink); font-size: 16px; }
.search-row button { padding: 10px 18px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; font-size: 15px; }
.search-row input:focus { outline: 2px solid rgba(9, 120, 137, .2); outline-offset: 0; }
.search-status { min-height: 1.5em; margin: 5px 0 0; color: var(--muted); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 13px; }
.search-results { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; max-height: 420px; margin-top: 6px; padding: 0; overflow-y: auto; background: transparent; }
.search-results[hidden] { display: none; }
.search-results a { display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; background: #fffdf9; border: 1px solid var(--line); color: var(--ink); line-height: 1.45; text-decoration: none; }
.search-results a:hover strong { color: var(--accent); }
.search-results strong { font-weight: 500; }
.search-results span { flex: 0 0 auto; color: var(--muted); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 12px; }
.search-more { grid-column: 1 / -1; margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 34px;
    max-width: 1180px;
    margin: 0 auto 48px;
    padding: 42px 36px 52px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.article-main { min-width: 0; }
.page-title { margin: 0 0 26px; padding-bottom: 15px; border-bottom: 1px solid var(--line); font-size: 32px; font-weight: 500; }
.post-list { display: grid; gap: 22px; }

.post-card {
    padding: 27px 30px 25px;
    background: #fffdf9;
    border-left: 4px solid #d5c7b6;
    box-shadow: 0 5px 18px rgba(78, 59, 42, .055);
}

.post-thumbnail {
    display: block;
    margin: -27px -30px 22px;
    overflow: hidden;
    background: var(--paper-soft);
}

.post-thumbnail img {
    display: block;
    width: 100%;
    height: min(360px, 38vw);
    min-height: 210px;
    object-fit: cover;
    transition: transform .25s ease;
}

.post-thumbnail:hover img { transform: scale(1.015); }

.post-date, .article-meta, .post-categories {
    color: var(--muted);
    font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
    font-size: 14px;
    letter-spacing: .04em;
}

.post-card h2 { margin: 5px 0 7px; font-size: 27px; font-weight: 500; line-height: 1.45; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.post-categories { margin: 0 0 9px; }
.post-summary { margin: 0; color: var(--ink); }
.read-more { display: inline-block; margin-top: 11px; color: var(--accent); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 14px; text-decoration: none; }
.read-more::after { content: " →"; }

.recent-posts { align-self: start; position: static; padding: 25px 24px; background: var(--sidebar-bg); }
.visitor-stats { margin-top: 22px; padding: 24px; background: var(--sidebar-bg); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; }
.visitor-stats h2 { margin: 0 0 15px; font-size: 23px; font-weight: 500; }
.visitor-stats p { margin: 0; color: var(--muted); font-size: 14px; }
.visitor-stats dl { margin: 0; }
.visitor-stats dl div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-top: 1px solid var(--line); }
.visitor-stats dt { color: var(--ink); }
.visitor-stats dd { margin: 0; color: var(--muted); font-weight: 600; }
.recent-posts h2 { margin: 0 0 15px; padding-bottom: 10px; border-bottom: 1px solid rgba(80, 60, 43, .22); font-size: 23px; font-weight: 500; }
.recent-filter-label { display: block; margin-bottom: 5px; color: var(--ink); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 13px; }
.recent-filter { width: 100%; padding: 9px 10px; border: 1px solid rgba(2, 62, 71, .22); border-radius: 2px; background: #fffdf9; color: var(--ink); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 14px; }
.recent-filter:focus { border-color: var(--muted); outline: 2px solid rgba(9, 120, 137, .16); }
.recent-result { margin: 6px 0 8px; color: var(--muted); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 12px; }
.recent-posts ul { margin: 0; padding: 0; list-style: none; }
.recent-posts li[hidden] { display: none; }
.recent-posts li { padding: 12px 0; border-bottom: 1px solid rgba(80, 60, 43, .14); line-height: 1.45; }
.recent-posts li:last-child { border-bottom: 0; }
.recent-posts a { display: block; color: var(--ink); font-size: 16px; text-decoration: none; }
.recent-posts a:hover { color: var(--accent); }
.recent-posts time { display: block; margin-top: 4px; color: var(--muted); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 12px; }

.single-article { padding: 5px 10px 30px; }
.article-header { margin-bottom: 34px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 42px); font-weight: 500; line-height: 1.4; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
.view-counter { margin: 8px 0 18px; color: var(--muted); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 13px; }
.view-counter strong { font-weight: 500; }
.article-content { overflow-wrap: anywhere; }
.article-content p { margin: 0 0 1.6em; }
.article-content h2, .article-content h3 { margin: 1.8em 0 .7em; line-height: 1.45; }
.article-content img { display: block; max-width: 100%; height: auto; margin: 28px auto; }
.article-content iframe { max-width: 100%; }
.article-content a { text-underline-offset: 3px; }
.article-contact { margin-top: 48px; padding: 24px 26px; border-top: 1px solid var(--line); background: var(--nav-bg); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 15px; }
.article-contact p { margin: 0 0 14px; }
.article-contact .contact-email { display: inline-block; margin-right: 14px; padding: 8px 16px; background: var(--accent); color: #fff; text-decoration: none; }
.article-contact .contact-email:hover { opacity: .86; }
.article-contact span { color: var(--muted); overflow-wrap: anywhere; }

.taxonomy-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.taxonomy-card { display: flex; justify-content: space-between; gap: 12px; padding: 22px; background: var(--paper-soft); color: var(--ink); text-decoration: none; }
.taxonomy-card:hover { background: #e9e0d4; }
.taxonomy-card small { color: var(--muted); white-space: nowrap; }

.related-series { margin: 0 0 28px; padding: 22px 24px; background: var(--paper-soft); }
.related-series h2 { margin: 0 0 13px; font-size: 22px; font-weight: 500; }
.series-links { display: flex; flex-wrap: wrap; gap: 10px; }
.series-links a { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); background: #fffdf9; color: var(--ink); text-decoration: none; }
.series-links a:hover { color: var(--accent); }
.series-links small { color: var(--muted); }

.series-intro { margin: -8px 0 26px; padding: 20px 22px; background: var(--paper-soft); }
.series-intro p { margin: 0 0 13px; }
.series-intro label { display: block; margin-bottom: 6px; font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 14px; }
.series-intro input { width: 100%; padding: 10px 13px; border: 1px solid rgba(2, 62, 71, .25); background: #fffdf9; color: var(--ink); font-size: 16px; }
.series-filter-status { min-height: 1.5em; margin: 5px 0 0 !important; color: var(--muted); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 13px; }
.series-search-results { display: grid; gap: 8px; margin-top: 8px; }
.series-search-results[hidden] { display: none; }
.series-search-results a { display: flex; justify-content: space-between; gap: 15px; padding: 10px 12px; border: 1px solid var(--line); background: #fffdf9; color: var(--ink); line-height: 1.45; text-decoration: none; }
.series-search-results a:hover strong { color: var(--accent); }
.series-search-results span { flex: 0 0 auto; color: var(--muted); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 13px; }
.series-search-results p { margin: 0; }
.post-card[hidden] { display: none; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 28px; padding: 16px; background: var(--paper-soft); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 14px; }
.pagination a { color: var(--accent); text-decoration: none; }
.article-meta a { color: var(--muted); text-underline-offset: 3px; }

.site-footer { max-width: 1180px; margin: 0 auto 32px; padding: 22px 36px; background: #d8cfc3; color: var(--ink); font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: 13px; }
.site-footer p { margin: 0; }

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 20;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(2, 62, 71, .22);
    border-radius: 50%;
    background: rgba(243, 238, 229, .94);
    color: var(--ink);
    box-shadow: 0 4px 14px rgba(2, 62, 71, .14);
    cursor: pointer;
    font-size: 21px;
    line-height: 40px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, background .2s ease;
}

.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: #fffdf9; }
.back-to-top:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }

@media (max-width: 850px) {
    body { font-size: 18px; }
    .site-header { margin-top: 0; }
    .site-branding { padding: 30px 24px 24px; }
    .site-nav { padding: 0 12px; }
    .site-nav a { padding: 13px 11px; }
    .site-search { padding: 20px; }
    .search-results { grid-template-columns: 1fr; }
    .page-layout { grid-template-columns: 1fr; gap: 30px; padding: 30px 22px 40px; }
    .recent-posts { position: static; }
    .post-card { padding: 22px 20px; }
    .post-thumbnail { margin: -22px -20px 18px; }
    .post-thumbnail img { height: 52vw; min-height: 180px; }
    .post-card h2 { font-size: 24px; }
    .taxonomy-list { grid-template-columns: 1fr; }
    .site-footer { margin-bottom: 0; }
}

@media (max-width: 480px) {
    .site-description { font-size: 14px; }
    .page-layout { padding-left: 15px; padding-right: 15px; }
    .single-article { padding-left: 3px; padding-right: 3px; }
    .back-to-top { right: 14px; bottom: 16px; width: 38px; height: 38px; font-size: 19px; line-height: 36px; }
}
.about-hero {
  height: min(32rem, 52vw);
  margin: 0 0 2rem;
  overflow: hidden;
}

.about-hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center bottom;
}
