:root {
  --ink: #101315;
  --ink-2: #161A1D;
  --line-dark: #2A3035;
  --paper: #F6F5F1;
  --paper-2: #EDEBE4;
  --card: #FFFFFF;
  --text: #1C1F22;
  --muted: #5C5953;
  --muted-light: #A3A09A;
  --gold: #C9A66B;
  --gold-ink: #7A5C2B;
  --line: #E2DFD6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: 'Noto Sans TC', system-ui, sans-serif; line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(16,19,21,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid #262B30; color: #F2F0EA; }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; background: var(--gold); display: inline-flex; align-items: center; justify-content: center; }
.brand-name { font-family: 'Inter Tight', sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 0.14em; }
.brand-sub { font-size: 13px; color: #9BA1A6; border-left: 1px solid #3A4147; padding-left: 12px; letter-spacing: 0.12em; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 22px; font-size: 14px; }
.nav-links a { text-decoration: none; color: #BDBAB2; padding: 10px 0; }
.nav-links a[aria-current="page"] { color: var(--gold); }
.nav-links a.btn { color: var(--ink); padding: 0 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 15px; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-ghost { border: 1px solid #4A5157; color: #F2F0EA; }
.btn-ghost-dark { border: 1px solid #4A5157; color: #F2F0EA; }

/* blog hero */
.blog-hero { background: var(--ink); color: #F2F0EA; padding: 72px 0 40px; background-image: linear-gradient(#181C1F 1px, transparent 1px), linear-gradient(90deg, #181C1F 1px, transparent 1px); background-size: 56px 56px; }
.kicker { margin: 0 0 12px; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--gold); letter-spacing: 0.08em; }
.hero-title { margin: 0; font-size: clamp(40px, 7vw, 84px); line-height: 1.05; font-weight: 900; letter-spacing: -0.02em; }
.hero-desc { margin: 18px 0 0; max-width: 34em; color: #BDBAB2; font-size: 17px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.cats a { text-decoration: none; border: 1px solid #3A4147; border-radius: 999px; padding: 8px 16px; font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; color: #F2F0EA; }
.cats a[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 700; }

/* list */
.list { padding-top: 48px; padding-bottom: 96px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.card { background: var(--card); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(16,19,21,0.08); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card-img { aspect-ratio: 1200 / 630; width: 100%; object-fit: cover; background: var(--paper-2); }
.card-img-blank { display: flex; align-items: flex-end; padding: 18px; background: var(--ink); background-image: linear-gradient(#1E2327 1px, transparent 1px), linear-gradient(90deg, #1E2327 1px, transparent 1px); background-size: 28px 28px; }
.card-img-blank span { color: var(--gold); font-weight: 900; font-size: 22px; }
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; }
.card-title { margin: 0; font-size: 20px; line-height: 1.45; font-weight: 700; }
.card-desc { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.meta-light { color: #A3A09A; }
.pill { background: var(--paper-2); color: var(--gold-ink); font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.empty { color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-decoration: none; }
.pagination a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* post */
.post-head { background: var(--ink); color: #F2F0EA; padding: 56px 0 48px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: #A3A09A; margin-bottom: 20px; }
.crumbs a { color: #BDBAB2; text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.post-title { margin: 0; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.3; font-weight: 900; letter-spacing: -0.01em; }
.post-lead { margin: 18px 0 20px; color: #CFCBC2; font-size: 17px; }
.post-cover { margin: -24px auto 0; }
.post-cover img { width: 100%; border-radius: 20px; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-layout { padding-top: 40px; padding-bottom: 72px; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px; margin-bottom: 36px; }
.toc-title { margin: 0 0 8px; font-weight: 700; font-size: 15px; }
.toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--gold-ink); text-decoration: underline; }

.prose { font-size: 17px; line-height: 1.95; color: var(--text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; font-size: 26px; line-height: 1.4; font-weight: 900; scroll-margin-top: 84px; padding-top: 4px; border-top: 2px solid var(--ink); padding-top: 18px; }
.prose h3 { margin-top: 1.8em; font-size: 20px; line-height: 1.5; font-weight: 700; scroll-margin-top: 84px; }
.prose p, .prose li { color: #2B2E31; }
.prose a { color: var(--gold-ink); text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 16px 20px; background: var(--paper-2); border-radius: 12px; color: var(--muted); }
.prose img { border-radius: 14px; margin: 1.6em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose th { background: var(--paper-2); font-weight: 700; }
.prose code { background: var(--paper-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.faq { margin-top: 48px; }
.faq h2 { font-size: 24px; font-weight: 900; margin: 0 0 16px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; padding-left: 16px; color: var(--gold-ink); font-size: 20px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--muted); }

.tags { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; color: var(--muted); background: var(--paper-2); padding: 4px 12px; border-radius: 999px; }

.cta { margin-top: 48px; background: var(--ink); color: #F2F0EA; border-radius: 24px; padding: 32px; }
.cta-kicker { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--gold); }
.cta-title { margin: 8px 0 6px; font-size: 24px; font-weight: 900; line-height: 1.35; }
.cta-text { margin: 0 0 20px; color: #BDBAB2; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.pager { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.pager-link { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-decoration: none; font-weight: 700; }
.pager-link span { font-size: 12px; color: var(--muted); font-weight: 400; }
.pager-right { text-align: right; }

.related { padding-bottom: 96px; }
.section-title { font-size: 26px; font-weight: 900; margin: 0 0 20px; }

/* footer */
.site-footer { background: var(--ink); color: #8A877F; font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 28px; }
.footer-inner a { color: #BDBAB2; }

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .nav-links { gap: 2px 16px; }
  .prose { font-size: 16px; }
  .cta { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } html { scroll-behavior: auto; } }
