:root {
  --ink: #111;
  --muted: #5c5c5c;
  --line: #cfcfcf;
  --blue: #0645d9;
  --blue-hover: #c00;
  --max: 1680px;
  --brand-font: Eurostile, "Square 721", "Bank Gothic", "DIN Alternate", "Arial Black", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Arial, "Noto Sans TC", "Noto Sans SC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.42;
}
a { color: var(--blue); text-decoration: underline; text-underline-offset: .12em; }
a:hover { color: var(--blue-hover); }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; top: -4rem; left: 1rem; z-index: 20; padding: .55rem .8rem; color: #fff; background: #000; }
.skip-link:focus { top: 1rem; }

.site-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: .55rem 1rem;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #888;
  background: #fafafa;
}
.site-name { color: #000; font-family: var(--brand-font); font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 1.2rem; }
.site-nav > a { color: #000; font-weight: 700; }
.menu-toggle { display: none; align-items: center; gap: .45rem; padding: .35rem .5rem; border: 1px solid #222; color: #fff; background: #333; font-weight: 700; }
.menu-icon { width: 1.1rem; display: grid; gap: 3px; }
.menu-icon span { display: block; height: 2px; background: #fff; }
.nav-category-menu { position: relative; }
.nav-category-menu summary { cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: .12em; }
.nav-category-links { position: absolute; z-index: 10; top: calc(100% + .55rem); right: 0; width: 520px; display: grid; grid-template-columns: repeat(2, 1fr); gap: .15rem .8rem; padding: .75rem; border: 1px solid #333; background: #fff; box-shadow: 3px 3px 0 rgba(0,0,0,.18); }
.nav-category-links a { padding: .2rem; }
.site-header form { display: flex; }
.site-header input { width: 210px; padding: .35rem .5rem; border: 1px solid #777; }
.site-header button, .page-search button {
  padding: .35rem .75rem;
  border: 1px solid #555;
  color: #fff;
  background: #333;
  font-weight: 700;
}
main { max-width: var(--max); margin: 0 auto; }

.directory-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.3rem 1rem 1rem;
  border-bottom: 1px solid var(--line);
}
.directory-intro.compact { padding-top: 1rem; }
.directory-intro h1 { margin: 0 0 .2rem; font-size: 2rem; line-height: 1.2; }
.directory-intro p { margin: .2rem 0; }
.breadcrumb { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.summary-stats { display: flex; margin: 0; border: 1px solid #777; }
.summary-stats div { min-width: 110px; padding: .45rem .7rem; border-right: 1px solid #aaa; }
.summary-stats div:last-child { border-right: 0; }
.summary-stats dt { color: var(--muted); font-size: .78rem; }
.summary-stats dd { margin: 0; font-weight: 800; }

.latest-section { padding: 1rem; border-bottom: 1px solid var(--line); }
.latest-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.latest-heading h2 { margin: 0; font-size: 1.35rem; }
.latest-heading p { margin: .1rem 0 0; color: var(--muted); font-size: .85rem; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.cover-card { min-width: 0; }
.cover-image { display: block; border: 1px solid #888; background: #eee; }
.cover-image img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.cover-card h3 { margin: .45rem 0 .12rem; font-size: .95rem; line-height: 1.25; }
.cover-card h3 a { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cover-card p { overflow: hidden; margin: 0; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.cover-category { display: inline-block; margin-top: .15rem; font-size: .8rem; }

.directory-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.2rem; padding: 1rem; }
.filters { align-self: start; }
.filters fieldset { margin: 0 0 1rem; padding: .65rem .75rem .75rem; border: 1px solid #222; }
.filters legend { padding: 0 .28rem; font-size: 1.02rem; font-weight: 800; }
.filters label { display: block; margin: .28rem 0; }
.filters input[type="checkbox"] { width: 1.05rem; height: 1.05rem; margin: 0 .4rem 0 0; vertical-align: -.13rem; accent-color: #1677ff; }
.filters select { width: 100%; padding: .4rem 2rem .4rem .5rem; border: 1px solid #777; background-color: #fff; }
.category-filter a { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem .25rem; }
.category-filter a[aria-current="page"] { color: #000; background: #ddd; font-weight: 800; text-decoration: none; }
.category-filter small { color: var(--muted); }

.directory-results { min-width: 0; }
.results-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .45rem; }
.results-header h2 { margin: 0; font-size: 1.35rem; }
.results-header p { margin: 0; color: var(--muted); font-size: .9rem; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid #222; }
.podcast-table, .metadata-table, .search-table, .about-table { width: 100%; border-collapse: collapse; }
.podcast-table { min-width: 1040px; }
.podcast-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .48rem .55rem;
  border-bottom: 2px solid #333;
  background: #eee;
  text-align: left;
  white-space: nowrap;
}
.podcast-table td { padding: .42rem .55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.podcast-table tbody tr:nth-child(even) { background: #fafafa; }
.podcast-table tbody tr:hover { background: #fffbd8; cursor: pointer; }
.podcast-table tbody tr:last-child td { border-bottom: 0; }
.podcast-table small, .metadata-table small { display: block; color: var(--muted); font-size: .78rem; }
.podcast-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.show-cell { min-width: 330px; display: flex; align-items: center; gap: .65rem; }
.show-cell img { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid #aaa; object-fit: cover; background: #eee; }
.show-cell > span { min-width: 0; }
.show-cell a { font-weight: 700; }
.icon, .text-icon { display: inline-grid; width: 1.28em; height: 1.28em; place-items: center; margin-right: .18rem; border: 1px solid #777; color: #111; background: #fff; font-size: .82em; line-height: 1; text-decoration: none; vertical-align: .08em; }
.svg-icon { width: 1.18em; height: 1.18em; border: 0; background: transparent; font-size: 1em; }
.svg-icon svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.source-link { white-space: nowrap; }
.empty-filter { padding: 1rem; border: 1px solid #222; border-top: 0; margin: 0; }
[hidden] { display: none !important; }

.detail-layout { width: 100%; max-width: 100%; display: grid; grid-template-columns: 280px minmax(0, 820px); gap: 2rem; justify-content: center; padding: 1.4rem 1rem 3rem; }
.detail-sidebar { min-width: 0; }
.detail-cover { width: 220px; height: 220px; object-fit: cover; border: 1px solid #555; }
.detail-actions { display: flex; align-items: flex-start; flex-direction: column; gap: .7rem; margin-top: 1rem; }
.button { display: inline-block; padding: .5rem .75rem; border: 1px solid #333; color: #fff; background: #222; font-weight: 700; text-decoration: none; }
.detail-actions .button { display: inline-flex; align-items: center; }
.button .svg-icon { color: inherit; }
.button:hover { color: #fff; background: #555; }
.detail-main { min-width: 0; max-width: 100%; }
.detail-main header { padding-bottom: 1rem; border-bottom: 1px solid #aaa; }
.detail-kicker { margin: 0 0 .5rem; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .06em; }
.detail-main h1 { margin: 0; font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.12; }
.creator { margin: .45rem 0 0; font-size: 1.15rem; font-weight: 700; }
.detail-main section { margin-top: 1.5rem; }
.detail-main h2 { margin: 0 0 .45rem; font-size: 1.25rem; }
.description { max-width: 70ch; margin: 0; overflow-wrap: anywhere; }
.metadata-wrap { border-color: #777; }
.metadata-table th, .metadata-table td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.metadata-table th { width: 220px; background: #eee; }
.metadata-table tr:last-child th, .metadata-table tr:last-child td { border-bottom: 0; }
.metadata-table code { font-size: 1em; }
.episode-table { width: 100%; border-collapse: collapse; }
.episode-table th, .episode-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.episode-table th { background: #eee; }
.episode-table th:nth-child(2), .episode-table td:nth-child(2), .episode-table th:nth-child(3), .episode-table td:nth-child(3), .episode-table th:nth-child(4), .episode-table td:nth-child(4) { width: 100px; white-space: nowrap; }
.episode-table small { display: block; margin-top: .18rem; color: var(--muted); font-size: .78rem; }
.episode-wrap { width: 100%; max-width: 100%; }
.episode-table { min-width: 720px; }
.episode-table td:first-child { min-width: 390px; }
.episode-table td:first-child > strong { display: block; }
.episode-table td:first-child > p { margin: .35rem 0; color: #333; font-size: .9rem; }
.episode-badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.episode-badges span { padding: .08rem .28rem; border: 1px solid #aaa; color: #444; background: #f5f5f5; font-size: .72rem; }
.episode-more { margin-top: .35rem; font-size: .8rem; }
.episode-more summary { color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: .12em; }
.episode-more dl { margin: .35rem 0 0; }
.episode-more dl div { display: grid; grid-template-columns: 70px 1fr; gap: .4rem; }
.episode-more dt { font-weight: 700; }
.episode-more dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.episode-listen { display: inline-flex; align-items: center; font-weight: 700; }
.episode-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.episode-section-heading p { margin: 0; color: var(--muted); font-size: .82rem; text-align: right; }
.episode-pagination { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem; border: 1px solid #777; border-top: 0; }
.episode-page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; }
.episode-page-numbers a, .episode-page-numbers strong { min-width: 1.8rem; padding: .18rem .35rem; border: 1px solid #999; text-align: center; }
.episode-page-numbers strong { color: #fff; background: #333; }
.internal-link-list { margin: .4rem 0 0; padding-left: 1.25rem; }
.muted-note { margin: .35rem 0 0; color: var(--muted); }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.related-item { min-width: 0; display: flex; align-items: center; gap: .65rem; padding: .65rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.related-item img { flex: 0 0 auto; width: 56px; height: 56px; border: 1px solid #aaa; object-fit: cover; }
.related-item span { min-width: 0; }
.related-item strong { display: block; line-height: 1.25; }
.related-item small { display: block; margin-top: .2rem; color: var(--muted); font-size: .78rem; }
.podcast-pagination { display: grid; grid-template-columns: 1fr 1fr; margin-top: 1.6rem; border: 1px solid #777; }
.podcast-pagination a { display: flex; flex-direction: column; padding: .7rem; text-decoration: none; }
.podcast-pagination a + a { border-left: 1px solid #aaa; text-align: right; }
.podcast-pagination small { color: var(--muted); }
.podcast-pagination strong { color: var(--blue); text-decoration: underline; text-underline-offset: .12em; }
.rights-note { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }

.plain-page { max-width: 1100px; min-height: 65vh; padding: 2rem 1rem 4rem; }
.plain-page h1 { margin: 0 0 1rem; font-size: 2rem; }
.plain-page .lead { font-size: 1.2rem; }
.page-search { max-width: 620px; margin: 1rem 0 1.5rem; }
.page-search label { display: block; margin-bottom: .3rem; font-weight: 700; }
.page-search div { display: flex; }
.page-search input { min-width: 0; flex: 1; padding: .48rem .55rem; border: 1px solid #555; }
.search-table, .about-table { border: 1px solid #555; }
.search-table th, .search-table td, .about-table th, .about-table td { padding: .55rem .65rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.search-table th, .about-table th { background: #eee; }
.about-table th { width: 190px; }
.status-code { margin: 0; color: var(--muted); font-size: 3rem; font-weight: 800; }

.site-footer { max-width: var(--max); display: grid; grid-template-columns: 1fr 2.2fr .8fr; gap: 2rem; margin: 0 auto; padding: 1.25rem 1rem; border-top: 1px solid #777; color: var(--muted); background: #fafafa; font-size: .85rem; }
.footer-brand, .footer-meta { display: flex; align-items: flex-start; flex-direction: column; gap: .3rem; }
.footer-brand > a { color: #000; font-family: var(--brand-font); font-size: 1.1rem; letter-spacing: .01em; }
.footer-categories > strong, .footer-meta > strong { display: block; margin-bottom: .35rem; color: #111; }
.footer-categories div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem .8rem; }

:focus-visible { outline: 3px solid #1677ff; outline-offset: 2px; }
@media (max-width: 900px) {
  .directory-intro { align-items: flex-start; flex-direction: column; }
  .directory-layout { grid-template-columns: 1fr; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .filters fieldset { margin: 0; }
  .category-filter { grid-column: 1 / -1; columns: 2; }
  .category-filter legend { column-span: all; }
  .detail-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .site-footer { grid-template-columns: 1fr 2fr; }
  .footer-meta { grid-column: 1 / -1; display: flex; flex-direction: row; flex-wrap: wrap; gap: .4rem 1rem; }
}
@media (max-width: 640px) {
  .site-header { position: relative; align-items: center; }
  .menu-toggle { display: inline-flex; }
  .site-nav { position: absolute; z-index: 30; top: 100%; right: .5rem; left: .5rem; display: none; align-items: stretch; flex-direction: column; gap: 0; padding: .75rem; border: 1px solid #333; background: #fff; box-shadow: 3px 3px 0 rgba(0,0,0,.18); }
  .site-nav.is-open { display: flex; }
  .site-nav > a, .nav-category-menu summary { padding: .55rem .35rem; color: #000; }
  .site-nav form { display: flex; margin-top: .5rem; }
  .site-nav form input { flex: 1; width: auto; min-width: 0; }
  .nav-category-menu { width: 100%; }
  .nav-category-links { position: static; width: 100%; grid-template-columns: 1fr; margin-top: .25rem; border-color: #aaa; box-shadow: none; }
  .directory-intro h1 { font-size: 1.65rem; }
  .latest-heading { align-items: flex-start; flex-direction: column; }
  .cover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem .75rem; }
  .summary-stats { width: 100%; }
  .summary-stats div { flex: 1; min-width: 0; }
  .filters { grid-template-columns: 1fr; }
  .category-filter { grid-column: auto; columns: 1; }
  .results-header { align-items: flex-start; flex-direction: column; }
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-cover { width: 150px; height: 150px; }
  .detail-sidebar { width: 100%; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1rem; }
  .detail-sidebar .breadcrumb { grid-column: 1 / -1; }
  .detail-actions { margin-top: 0; }
  .metadata-table th { width: 42%; }
  .metadata-table { table-layout: fixed; }
  .metadata-table td { overflow-wrap: anywhere; }
  .related-grid, .podcast-pagination { grid-template-columns: 1fr; }
  .episode-section-heading { align-items: flex-start; flex-direction: column; }
  .episode-section-heading p { text-align: left; }
  .episode-pagination { align-items: stretch; flex-direction: column; }
  .episode-pagination > a { text-align: center; }
  .podcast-pagination a + a { border-top: 1px solid #aaa; border-left: 0; text-align: left; }
  .site-footer { grid-template-columns: 1fr; gap: 1.2rem; }
  .footer-categories div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-meta { grid-column: auto; flex-direction: column; gap: .3rem; }
  .search-table, .about-table { display: block; overflow-x: auto; }
}

