:root {
  --ink: #17202a;
  --muted: #68717d;
  --line: #e4e7eb;
  --paper: #fff;
  --wash: #f5f6f7;
  --accent: #164b8b;
  --accent-soft: #eaf1f8;
  --shadow: 0 18px 50px rgba(30, 42, 56, .08);
  --shell: 1180px;
  --reading: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.shell-narrow { width: min(calc(100% - 40px), var(--reading)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid rgba(228, 231, 235, .85);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: .75em; font-weight: 600; }
.brand-dot {
  width: 26px; height: 12px; flex: 0 0 26px;
  background:
    radial-gradient(circle at 6px 6px, var(--accent) 0 5px, transparent 5.5px),
    radial-gradient(circle at 20px 6px, #9fb6ce 0 5px, transparent 5.5px);
}
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: #46505c; font-size: 15px; font-weight: 650; }
.main-nav a:hover, .main-nav .active { color: var(--accent); }
.menu-button { display: none; padding: 7px 11px; border: 1px solid var(--line); background: #fff; border-radius: 9px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, .45fr);
  gap: 26px;
  padding-top: 72px;
  padding-bottom: 88px;
}
.hero-single { display: block; }
.hero-single .hero-main { min-height: 500px; }
.hero-main {
  min-height: 540px; display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(34px, 7vw, 78px);
  flex-direction: column; background: var(--wash); border-radius: 3px 80px 3px 3px;
}
.kicker {
  margin: 0 0 15px; color: var(--accent); font-size: 13px;
  font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
}
.hero h1 {
  max-width: 800px; margin: 0; font-size: clamp(44px, 7vw, 78px);
  line-height: 1.12; letter-spacing: -.055em;
}
.hero-lead { max-width: 660px; margin: 28px 0 32px; color: var(--muted); font-size: 19px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; color: #fff; background: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px;
  font-size: 15px; font-weight: 750; cursor: pointer;
}
.button:hover { background: #0e396c; }
.hero-note {
  min-height: 540px; display: flex; justify-content: space-between;
  padding: 32px; color: #fff; background: var(--accent);
  flex-direction: column; border-radius: 3px;
}
.hero-note span { color: #b7cbe1; font-size: 12px; font-weight: 800; letter-spacing: .15em; }
.hero-note p { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.45; font-weight: 650; letter-spacing: -.02em; }

.section { padding: 0 0 100px; }
.section.compact { padding-top: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-heading h2, .page-heading h1 { margin: 0; font-size: clamp(34px, 5vw, 52px); line-height: 1.15; letter-spacing: -.04em; }
.text-link { color: var(--accent); font-size: 14px; font-weight: 750; }
.text-link::after { content: " ↗"; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 3px; transition: .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-cover { aspect-ratio: 16 / 10; display: grid; overflow: hidden; place-items: center; color: var(--accent); background: var(--accent-soft); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover span { padding: 20px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.post-card-body { padding: 24px; }
.post-meta { margin: 0 0 9px; color: var(--muted); font-size: 13px; }
.post-meta a:hover { color: var(--accent); }
.post-card h2 { margin: 0 0 10px; font-size: 21px; line-height: 1.42; letter-spacing: -.025em; }
.post-card h2 a:hover { color: var(--accent); }
.post-card-body > p:not(.post-meta) { min-height: 3.4em; margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.empty { padding: clamp(35px, 7vw, 72px); text-align: center; background: var(--wash); border-radius: 3px; }
.empty h1, .empty h2 { margin: 0 0 12px; }

.page-heading { padding-top: 90px; padding-bottom: 58px; }
.page-heading > p:last-child { color: var(--muted); }
.category-filter { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.category-filter a {
  padding: 7px 15px; color: #46505c; background: var(--wash);
  border: 1px solid transparent; border-radius: 999px;
  font-size: 14px; font-weight: 700;
}
.category-filter a:hover, .category-filter a.active {
  color: #fff; background: var(--accent);
}
.article { padding-top: 92px; padding-bottom: 110px; }
.article-header { margin-bottom: 48px; }
.article-header h1 { margin: 0 0 18px; font-size: clamp(40px, 7vw, 66px); line-height: 1.16; letter-spacing: -.05em; }
.article-intro { margin: 28px 0 0; color: var(--muted); font-size: 20px; line-height: 1.7; }
.article-cover { width: 100%; margin-bottom: 50px; border-radius: 3px; }
.article-content { font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 19px; line-height: 1.95; }
.article-content h2, .article-content h3 { margin-top: 2em; font-family: Inter, sans-serif; line-height: 1.4; letter-spacing: -.025em; }
.article-content h2 { font-size: 30px; }
.article-content h3 { font-size: 23px; }
.article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-content blockquote { padding: 20px 24px; margin: 34px 0; color: #38495d; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.article-content img { margin: 34px auto; border-radius: 3px; }
.article-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-family: Inter, sans-serif; font-size: 15px; }
.article-content th, .article-content td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.article-content th { background: var(--wash); }
.article-end { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; margin-top: 60px; border-top: 1px solid var(--line); }
.article-end span { color: var(--muted); font-size: 11px; letter-spacing: .18em; }
.comments-section { padding-top: 72px; margin-top: 72px; border-top: 1px solid var(--line); }
.comments-heading {
  display: flex; align-items: end; justify-content: space-between;
  gap: 20px; margin-bottom: 28px;
}
.comments-heading h2 { margin: 0; font-size: 34px; line-height: 1.2; letter-spacing: -.035em; }
.comments-heading > span { color: var(--muted); font-size: 14px; }
.comment-form {
  position: relative; display: grid; gap: 18px;
  padding: 26px; background: var(--wash); border-radius: 3px;
}
.comment-form label { display: grid; gap: 7px; color: #38424e; font-size: 14px; font-weight: 750; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 12px 14px; color: var(--ink); background: #fff;
  border: 1px solid #d5d9de; border-radius: 6px; outline: none;
}
.comment-form textarea { resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.comment-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.comment-form-footer p { margin: 0; color: var(--muted); font-size: 13px; }
.comment-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.comment-message { padding: 11px 14px; margin: 0 0 18px; border-radius: 6px; font-size: 14px; font-weight: 700; }
.comment-message.success { color: #17643a; background: #e7f8ed; }
.comment-message.error { color: #8a2922; background: #fff0ef; }
.comment-list { margin-top: 38px; }
.comment {
  position: relative; padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.comment:first-child { border-top: 1px solid var(--line); }
.comment header { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.comment header strong { font-size: 16px; }
.comment time { color: var(--muted); font-size: 12px; }
.comment > p { margin: 12px 0 0; white-space: normal; overflow-wrap: anywhere; }
.comment form { margin-top: 10px; }
.comment-delete { padding: 0; color: #9f2f28; background: none; border: 0; font-size: 12px; cursor: pointer; }
.comments-empty { padding: 26px 0; color: var(--muted); text-align: center; }
.search-heading { max-width: 760px; margin-inline: auto; }
.search-form { display: flex; gap: 10px; margin-top: 30px; }
.search-form input { min-width: 0; flex: 1; padding: 13px 17px; border: 1px solid var(--line); border-radius: 999px; outline: none; }
.search-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-count { color: var(--muted); }
.page-error { margin-top: 90px; margin-bottom: 90px; }
.site-footer { padding: 52px 0; color: #d4d9df; background: #19222d; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; }
.site-footer strong { color: #fff; }
.site-footer p { max-width: 570px; margin: 6px 0 0; font-size: 13px; }

@media (max-width: 900px) {
  .menu-button { display: block; }
  .main-nav {
    position: absolute; top: 76px; right: 20px; left: 20px;
    display: none; padding: 14px; background: #fff;
    border: 1px solid var(--line); box-shadow: var(--shadow);
    flex-direction: column; align-items: stretch; gap: 2px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 9px 10px; }
  .hero { grid-template-columns: 1fr; }
  .hero-main, .hero-note { min-height: auto; }
  .hero-note { min-height: 320px; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .shell, .shell-narrow { width: min(calc(100% - 28px), var(--shell)); }
  .brand small { display: none; }
  .hero { padding-top: 28px; padding-bottom: 60px; }
  .hero-main { padding: 34px 24px; border-radius: 3px 44px 3px 3px; }
  .hero h1 { font-size: 43px; }
  .hero-lead { font-size: 17px; }
  .post-grid { grid-template-columns: 1fr; }
  .section-heading, .footer-inner { align-items: flex-start; flex-direction: column; }
  .page-heading, .article { padding-top: 58px; }
  .article-content { font-size: 18px; }
  .comments-heading, .comment-form-footer { align-items: stretch; flex-direction: column; }
  .comment-form-footer .button { width: 100%; }
  .comment header { align-items: flex-start; flex-direction: column; gap: 2px; }
  .search-form { align-items: stretch; flex-direction: column; }
}
