@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@500;700;900&family=Noto+Sans+TC:wght@400;500;700&display=swap');

:root {
  --paper: #f6f1e6;
  --paper-raised: #fffdf8;
  --ink: #23293b;
  --ink-soft: #4b5164;
  --seal: #9c3b2c;
  --seal-dark: #7c2d21;
  --gold: #ad8a3f;
  --line: #ddd3ba;
  --radius: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  line-height: 1.8;
  font-size: 16px;
}

a { color: var(--seal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Noto Serif TC', serif;
  color: var(--ink);
  line-height: 1.4;
  margin: 0 0 .6em;
}

img { max-width: 100%; height: auto; border-radius: var(--radius); }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- 頂部：證書式標頭 ---------- */
.site-header {
  background: var(--paper-raised);
  border-bottom: 3px double var(--gold);
  padding: 34px 0 22px;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-seal {
  flex: 0 0 auto;
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 2px dashed var(--seal);
  display: flex; align-items: center; justify-content: center;
  color: var(--seal);
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  font-size: 13px;
  text-align: center;
  transform: rotate(-8deg);
  letter-spacing: 1px;
  user-select: none;
}
.site-title-block { flex: 1 1 300px; }
.site-title {
  font-size: 30px;
  font-weight: 900;
  margin: 0;
}
.site-title a { color: var(--ink); }
.site-title a:hover { text-decoration: none; }
.site-desc {
  color: var(--ink-soft);
  margin-top: 4px;
  font-size: 14.5px;
}

.site-nav {
  margin-top: 20px;
}
.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 0; margin: 0;
}
.site-nav a {
  display: inline-block;
  padding: 7px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14.5px;
  background: var(--paper);
}
.site-nav a:hover, .site-nav a.active {
  background: var(--seal);
  border-color: var(--seal);
  color: #fff;
  text-decoration: none;
}

/* ---------- 內文區 ---------- */
main { padding: 40px 0 60px; }

.page-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 28px;
}
.page-heading h1 { font-size: 24px; }

.post-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.post-card h2 {
  font-size: 19px;
  margin-bottom: 6px;
}
.post-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.post-meta .badge {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px;
  margin-right: 6px;
}
.post-excerpt { color: var(--ink-soft); font-size: 15px; }

.pagination {
  display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-raised);
}
.pagination .current { background: var(--seal); border-color: var(--seal); color: #fff; }

/* ---------- 單篇文章 ---------- */
.post-full {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 34px;
}
.post-full h1 { font-size: 27px; }
.post-content { margin-top: 22px; font-size: 16px; }
.post-content p { margin: 0 0 1.1em; }
.post-content img { display: block; margin: 14px auto; }
.post-content table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.post-content table td, .post-content table th { border: 1px solid var(--line); padding: 6px 10px; }
.wp-caption { text-align: center; font-size: 13px; color: var(--ink-soft); }

.tag-row { margin-top: 26px; }

/* ---------- 側邊/區塊 ---------- */
.section-title {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 12px;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
}
.cat-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 30px; }
.cat-cloud a {
  font-size: 13px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-raised);
}
.cat-cloud a:hover { border-color: var(--seal); color: var(--seal); text-decoration: none; }

/* ---------- 留言 ---------- */
.comments { margin-top: 40px; }
.comment {
  border-left: 3px solid var(--gold);
  padding: 10px 16px;
  margin-bottom: 14px;
  background: var(--paper);
}
.comment .c-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.comment .c-meta b { color: var(--ink); }
.comment-children { margin-left: 22px; margin-top: 10px; }
.comment-form { margin-top: 24px; }
.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14.5px;
  margin-bottom: 10px;
  background: #fff;
}
.comment-form button {
  background: var(--seal);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14.5px;
  font-family: inherit;
}
.comment-form button:hover { background: var(--seal-dark); }
.form-row-2 { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row-2 > * { flex: 1 1 200px; }

.notice { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.notice.ok { background: #eaf3e5; color: #33612c; border: 1px solid #b9d7ab; }
.notice.pending { background: #fbf3df; color: #7a5b16; border: 1px solid #edd79a; }

.empty { color: var(--ink-soft); padding: 30px 0; text-align: center; }

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--ink-soft);
  font-size: 13.5px;
  text-align: center;
}

@media (max-width: 600px) {
  .site-header-inner { flex-direction: column; align-items: flex-start; }
  .post-full { padding: 22px 18px; }
}
