:root {
  color-scheme: light;
  --ink: #112b29;
  --muted: #50625d;
  --dark: #0e2825;
  --dark-raised: #173831;
  --paper: #f7f8f3;
  --surface: #fff;
  --line: #d6ddd6;
  --gold: #eed1a0;
  --green: #155845;
  --sans: "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--sans); }
img, video { display: block; max-width: 100%; }
a { color: var(--green); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid #b27529; outline-offset: 4px; }
.wrap { width: min(100% - 3.5rem, 76rem); margin-inline: auto; }
.skip-link { position: fixed; inset: .6rem auto auto .6rem; z-index: 3; padding: .6rem .9rem; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header, .site-footer { background: var(--dark); color: #eef3ed; }
.header-inner { min-height: 4.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; flex-direction: column; width: max-content; color: #fff; text-decoration: none; }
.brand:hover { color: var(--gold); }
.brand-name { font: 700 1.15rem/1.12 var(--serif); letter-spacing: .07em; white-space: nowrap; }
.brand-en { margin-top: .35rem; font: 610 .73rem/1 var(--sans); letter-spacing: .17em; color: var(--gold); white-space: nowrap; }
.top-nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: clamp(.7rem, 3vw, 2.1rem); }
.top-nav a, .site-footer nav a { position: relative; color: #edf4ef; text-decoration: none; font-size: .9rem; }
.top-nav a { padding-block: .65rem; }
.top-nav a[aria-current="page"]::after { content: ""; position: absolute; height: 2px; bottom: .2rem; inset-inline: 0; background: var(--gold); }
.top-nav a:hover, .site-footer nav a:hover { color: var(--gold); }
.site-footer { margin-top: clamp(2.5rem, 7vw, 6.75rem); }
.footer-inner { min-height: 9rem; display: flex; gap: 1.2rem 2rem; justify-content: space-between; align-items: center; padding-block: 2rem; }
.footer-inner p { margin: 1rem 0 0; color: #c1d2c8; font-size: .9rem; }

.masthead { border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; padding: clamp(2rem, 5vw, 4.5rem) 0 1.4rem; }
.masthead h1, .article-header h1 { margin: 0; font: 750 clamp(2.35rem, 7.5vw, 5rem)/1.09 var(--serif); letter-spacing: -.045em; text-wrap: balance; }
.masthead p { margin: .9rem 0 0; color: var(--muted); font-size: 1.02rem; }
.archive-jump { display: inline-flex; min-height: 44px; align-items: center; white-space: nowrap; border-bottom: 1px solid #547c6c; text-decoration: none; color: var(--green); }
.archive-jump:hover { border-color: var(--ink); }
.feature { display: grid; grid-template-columns: minmax(14rem, .88fr) minmax(0, 1.12fr); gap: clamp(1.5rem, 4.5vw, 4.5rem); align-items: center; background: var(--dark-raised); color: #f6faf4; border-radius: .6rem; margin: 1.6rem 0 clamp(2.75rem, 6vw, 5rem); overflow: hidden; }
.feature-image { height: 100%; min-height: 17rem; display: grid; place-items: center; background: #122e2a; }
.feature-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.feature-copy { padding: 1.8rem clamp(1.4rem, 4vw, 3.6rem) 1.8rem 0; }
.feature h2 { font: 730 clamp(1.65rem, 3.6vw, 3.1rem)/1.25 var(--serif); text-wrap: pretty; margin: .75rem 0 .75rem; }
.feature h2 a { color: #fff; text-decoration: none; }
.feature h2 a:hover { color: var(--gold); }
.feature .card-meta { color: #c1d2c9; }
.feature .card-meta strong { color: var(--gold); }
.feature-excerpt { margin: 0 0 .75rem; color: #dbe7df; line-height: 1.65; }
.feature .summary-label { color: var(--gold); background: #304730; }

.archive-section { scroll-margin-top: 1rem; }
.archive-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: .9rem; }
.archive-heading h2, .related h2 { margin: 0; font: 740 clamp(1.5rem, 4vw, 2.35rem)/1.25 var(--serif); }
.archive-heading p { margin: 0; color: var(--muted); font-size: .91rem; white-space: nowrap; }
.filters { display: grid; grid-template-columns: minmax(12rem, 1.45fr) minmax(0, .83fr) minmax(0, .94fr) auto; align-items: end; gap: .8rem; margin: 1.2rem 0; }
.filters label { display: grid; min-width: 0; gap: .34rem; font-weight: 650; font-size: .87rem; }
.filters select, .filters input, button { min-height: 2.75rem; font: inherit; }
.filters select, .filters input { width: 100%; border: 1px solid #aebdb5; border-radius: .35rem; color: var(--ink); background: var(--surface); font-size: 1rem; font-weight: 400; }
.filters input { padding: .52rem .7rem .52rem 2.1rem; }
.filters select { appearance: none; padding: .52rem 2rem .52rem .7rem; background-image: linear-gradient(45deg, transparent 50%, #395951 50%), linear-gradient(135deg, #395951 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.search-control { position: relative; }
.search-icon { position: absolute; top: .85rem; left: .68rem; height: .75rem; width: .75rem; border: 1.5px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: .4rem; height: 1.5px; background: var(--muted); bottom: -.13rem; right: -.28rem; transform: rotate(45deg); }
button { border: 1px solid #b4c1b7; border-radius: .35rem; padding: .45rem .82rem; background: var(--surface); color: var(--ink); cursor: pointer; }
button:hover:not(:disabled) { background: #e7eee6; }
button:disabled { opacity: .44; cursor: default; }
.empty-results { margin: 2rem 0; color: var(--muted); }

.post-grid { display: grid; padding: 0; margin: 1.25rem 0 0; list-style: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; }
.post-card, .post-card article { min-width: 0; height: 100%; }
.card-link { height: 100%; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; border-radius: .44rem; overflow: hidden; }
.card-link:hover { border-color: #6f9689; }
.card-link:hover h3 { text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .22em; }
.card-cover { display: grid; place-items: center; width: 100%; aspect-ratio: 1.75; background: #eef2ef; border-bottom: 1px solid var(--line); }
.card-cover img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.cover-placeholder { color: #657972; font: 650 .9rem/1.2 var(--serif); letter-spacing: .15em; }
.feature-image .cover-placeholder { color: #b6c4bc; }
.card-copy { padding: 1rem 1.1rem 1.15rem; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; margin: 0; color: var(--muted); font-size: .89rem; }
.card-topic { color: #365e50; }
.card-copy h3 { margin: .45rem 0 .5rem; font: 720 clamp(1.12rem, 2.65vw, 1.45rem)/1.35 var(--serif); text-wrap: pretty; }
.card-excerpt { margin: 0; color: var(--muted); font-size: .94rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-excerpt:empty, .feature-excerpt:empty { display: none; }
.summary-label { display: inline-flex; margin-top: .75rem; padding: .12rem .44rem; color: #365543; background: #edf3eb; border-radius: .2rem; font-size: .875rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: 1.6rem; }
.pagination span { color: var(--muted); font-size: .9rem; }

.reading-page, .notice-page { max-width: 54rem; }
.breadcrumb { padding-top: 1.35rem; font-size: .95rem; }
.breadcrumb a { text-underline-offset: .2em; }
.reading { margin-top: clamp(1.4rem, 4vw, 3.2rem); }
.article-header { border-bottom: 1px solid var(--line); margin-bottom: 1.45rem; padding-bottom: 1.35rem; }
.article-header h1 { margin-top: .5rem; font-size: clamp(2.05rem, 6vw, 3.75rem); letter-spacing: -.035em; line-height: 1.19; }
.article-meta { display: flex; flex-wrap: wrap; gap: .2rem .55rem; color: var(--muted); font-size: .98rem; margin: 0; }
.separator { color: #6b7e75; }
.article-tags { display: flex; gap: .42rem; flex-wrap: wrap; margin-top: 1.1rem; }
.tag { border: 1px solid #c4d0c6; background: #eef3ec; border-radius: .28rem; text-decoration: none; padding: .15rem .45rem; font-size: .875rem; }
.tag:hover { border-color: var(--green); }
.article-cover { width: min(100%, 45rem); margin: 0 auto 1.45rem; background: #eef2ef; border-radius: .42rem; overflow: hidden; }
.article-cover img { margin: 0 auto; max-height: min(70vw, 32rem); object-fit: contain; }
.article-status { color: #355b4b; background: #ebf2eb; border-left: 3px solid #51816d; padding: .7rem .95rem; margin: 1rem 0 1.3rem; }
.article-body { font-size: clamp(1.02rem, 2vw, 1.17rem); line-height: 1.83; overflow-wrap: anywhere; }
.article-body p { margin: 0 0 1.09em; }
.article-body h2, .article-body h3, .article-body h4 { line-height: 1.35; text-wrap: pretty; font-family: var(--serif); margin-top: 1.65em; margin-bottom: .55em; }
.article-body a { text-underline-offset: .18em; }
.article-body img { height: auto; margin-inline: auto; }
.article-body figure { margin: 1.5rem 0; }
.article-body figcaption { color: var(--muted); padding-top: .38rem; font-size: .93rem; }
.article-body video, .article-body iframe { max-width: 100%; }
.article-body ul, .article-body ol { padding-inline-start: 1.6em; }
.article-body blockquote { margin: .9rem 0; padding: .25rem 1rem; border-left: 3px solid #a9b7aa; background: #eef2ef; }
.article-body table { max-width: 100%; display: block; overflow: auto; border-collapse: collapse; }
.article-body td, .article-body th { border: 1px solid #bfcac0; padding: .42rem .55rem; }
.article-body pre { overflow: auto; }
.related { margin-top: 2.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.55rem; }
.related ul { list-style: none; padding: 0; margin: .7rem 0 0; }
.related li + li { border-top: 1px solid var(--line); }
.related a { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; padding: .67rem 0; text-decoration: none; }
.related a:hover span { text-decoration: underline; text-underline-offset: .2em; }
.related time { color: var(--muted); white-space: nowrap; font-size: .87rem; }
.notice-page .reading { margin-top: clamp(2.15rem, 8vw, 6rem); min-height: 36vh; }
.notice-nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }
.button-link, .secondary-link { display: inline-flex; align-items: center; min-height: 44px; }
.button-link { border-radius: .35rem; padding: 0 .85rem; background: var(--dark-raised); color: #fff; text-decoration: none; }
.button-link:hover { color: var(--gold); }

@media (max-width: 850px) {
  .wrap { width: min(100% - 2.25rem, 76rem); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .filters .search-field { grid-column: 1 / -1; }
}

@media (max-width: 575px) {
  .wrap { width: calc(100% - 1.5rem); }
  .header-inner { min-height: 4.2rem; }
  .brand-name { font-size: 1rem; }
  .brand-en { font-size: .62rem; }
  .top-nav { gap: .85rem; }
  .top-nav a { font-size: .82rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .masthead { padding-top: 1.75rem; align-items: flex-start; flex-direction: column; gap: .5rem; }
  .masthead h1 { font-size: 2.55rem; }
  .masthead p { margin-top: .55rem; }
  .feature { display: block; margin-top: 1.1rem; }
  .feature-image { min-height: 0; }
  .feature-image img { aspect-ratio: 1.9; }
  .feature-copy { padding: 1.02rem; }
  .feature h2 { margin: .45rem 0 .65rem; }
  .post-grid { grid-template-columns: 1fr; gap: .78rem; }
  .card-link { display: grid; grid-template-columns: clamp(5.8rem, 26vmin, 8.4rem) minmax(0, 1fr); }
  .card-cover { height: 100%; min-height: 6.5rem; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); }
  .card-copy { padding: .68rem .74rem; }
  .card-copy h3 { margin: .22rem 0 .3rem; font-size: 1.05rem; }
  .card-excerpt { font-size: .875rem; }
  .card-meta { font-size: .8rem; }
  .card-topic { display: none; }
  .summary-label { margin-top: .45rem; font-size: .78rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters button { justify-self: start; }
  .related a { align-items: baseline; flex-wrap: wrap; }
}

@media print {
  .site-header, .site-footer, .breadcrumb, .related { display: none; }
  body { background: #fff; color: #111; }
  .wrap { width: 100%; }
}
