:root {
  --fg: #1c1917; --muted: #6b6560; --bg: #fdfcfa; --card: #ffffff;
  --border: #e8e5e1; --accent: #047857; --accent-weak: #ecfdf5;
  --maxw: 46rem; --maxw-wide: 68rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.75; font-size: 17px; letter-spacing: 0.01em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p a, li a, blockquote a { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.3; letter-spacing: 0.02em; }
code { background: var(--accent-weak); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
pre { background: #1c1917; color: #e8e5e1; padding: 1rem 1.25rem; border-radius: 8px; overflow-x: auto; line-height: 1.6; }
pre code { background: none; padding: 0; color: inherit; }
blockquote { margin: 1.5rem 0; padding: 0.5rem 1.25rem; border-left: 3px solid var(--accent); background: var(--accent-weak); border-radius: 0 8px 8px 0; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.container-wide { max-width: var(--maxw-wide); margin: 0 auto; padding: 0 1.25rem; }

/* nav */
.site-nav { display: flex; justify-content: space-between; align-items: center; max-width: var(--maxw-wide); margin: 0 auto; padding: 1rem 1.25rem; }
.site-nav .brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); }
.site-nav nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav nav a { color: var(--muted); font-size: 0.95rem; }
.site-nav nav a.active, .site-nav nav a:hover { color: var(--accent); text-decoration: none; }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; padding: 2rem 1.25rem 3rem; text-align: center; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.footer-links a { color: var(--muted); font-size: 0.95rem; }
.footer-note { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* page & post */
.page, .post { padding-top: 1.5rem; }
.post-header h1 { margin-bottom: 0.25rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.post-meta a { color: var(--muted); }
.post-tags { margin-top: 2.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.post-tags a, .tag-chip { background: var(--accent-weak); color: var(--accent); padding: 0.1em 0.7em; border-radius: 999px; font-size: 0.85rem; }
.related { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.5rem; }
.related h2 { font-size: 1.1rem; }
.related ul { padding-left: 1.2rem; }

/* blog list */
.post-list { list-style: none; padding: 0; }
.post-list li { border-bottom: 1px solid var(--border); padding: 1.5rem 0; }
.post-list h2 { margin: 0 0 0.35rem; font-size: 1.3rem; }
.post-list h2 a { color: var(--fg); }
.post-list h2 a:hover { color: var(--accent); }
.post-list .excerpt { color: var(--muted); margin: 0.25rem 0 0.5rem; }
.post-list .meta { color: var(--muted); font-size: 0.85rem; }
.pagination { display: flex; justify-content: space-between; padding: 2rem 0; }
#blog-search { width: 100%; padding: 0.6rem 1rem; font-size: 1rem; border: 1px solid var(--border); border-radius: 8px; margin: 1rem 0; background: var(--card); }

/* landing */
.hero { text-align: center; padding: 4.5rem 1.25rem 3.5rem; }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); max-width: 34ch; margin: 0 auto 1rem; }
.hero .sub { color: var(--muted); font-size: 1.1rem; max-width: 52ch; margin: 0 auto 2rem; }
.section { padding: 3.5rem 0; }
.section-title { text-align: center; font-size: 1.6rem; margin-bottom: 0.5rem; }
.section-lead { text-align: center; color: var(--muted); margin: 0 auto 2.5rem; max-width: 52ch; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.work-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.work-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); text-decoration: none; }
.work-card img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border-bottom: 1px solid var(--border); }
.work-card .body { padding: 0.9rem 1.1rem 1.1rem; }
.work-card h3 { margin: 0 0 0.25rem; font-size: 1.05rem; color: var(--fg); }
.work-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.work-card .card-main { display: block; color: inherit; }
.work-card .card-main:hover { text-decoration: none; }
.work-card .series { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0 1.1rem 1rem; }
.work-card .series .lbl { font-size: 0.8rem; color: var(--muted); }
.work-card .series a { font-size: 0.8rem; color: var(--accent); background: var(--accent-weak); border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.7rem; text-decoration: none; }
.work-card .series a:hover { text-decoration: underline; }
.story { background: var(--accent-weak); border-radius: 16px; padding: 2.5rem 2rem; }
.story p { max-width: var(--maxw); margin: 0 auto 1rem; }
.featured-list { list-style: none; padding: 0; max-width: var(--maxw); margin: 0 auto; }
.featured-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.featured-list a { font-size: 1.1rem; }
.featured-list .why { color: var(--muted); font-size: 0.9rem; margin: 0.15rem 0 0; }

/* signup */
.signup { max-width: 30rem; margin: 0 auto; text-align: center; }
.signup h2 { font-size: 1.25rem; }
.signup form { display: flex; gap: 0.5rem; margin-top: 1rem; }
.signup input[type=email] { flex: 1; padding: 0.65rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }
.signup button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 0.65rem 1.4rem; font-size: 1rem; cursor: pointer; }
.signup button:hover { filter: brightness(1.1); }
.signup .msg { min-height: 1.5rem; font-size: 0.9rem; color: var(--accent); margin-top: 0.5rem; }
.signup .hp { position: absolute; left: -9999px; }

@media (max-width: 640px) {
  .site-nav { flex-direction: column; gap: 0.5rem; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .signup form { flex-direction: column; }
}
