/* AGY 版內頁共用編輯設計系統（與首頁固定表頭及排版語彙一致） */
:root {
  --paper: #fcfaf5;
  --paper-tint: #f1f2ee;
  --ink: #1e2838;
  --ink-body: #25303f;
  --ink-deck: #313e4d;
  --ink-sub: #404d5b;
  --muted: #53606b;
  --blue: #203877;
  --pale: #e7ebf4;
  --gold: #ffcf6d;
  --line: #c9c9bf;
  --rule-head: #4a5668;
  --rule-mid: #8c949e;
  --rule-soft: #c9c9bf;
  --rule-ledger: #bfc3be;
  --serif: "Songti TC", "Noto Serif TC", "PMingLiU", "MingLiU", serif;
  --sans: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 1.25rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  overflow-wrap: anywhere;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #b45412;
  outline-offset: 4px;
}

input:focus-visible,
select:focus-visible {
  outline: 2px solid #b45412;
  outline-offset: 1px;
  border-color: #b45412;
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure,
ul,
ol,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 700;
}

h1 {
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.2;
  letter-spacing: 0.015em;
  color: var(--blue);
}

h2 {
  font-size: clamp(26px, 2.7vw, 36px);
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: var(--blue);
}

h3 {
  font-family: var(--serif);
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: 0.015em;
  color: var(--blue);
}

p + p {
  margin-top: 1em;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(1200px, calc(100% - 112px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 18px;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* ── 共用頁首與頁尾（與 AGY 首頁 100% 對齊） ── */
.top {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.top-inner,
.brand,
.nav,
.footer-inner {
  display: flex;
  align-items: center;
}

.top-inner {
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand {
  gap: 14px;
  color: var(--blue);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.07em;
}

.crest {
  display: inline-block;
  width: 27px;
  height: 30px;
  border: 2px solid currentColor;
  border-radius: 12px 12px 1px 12px;
  position: relative;
  transform: rotate(-6deg);
  flex: none;
}

.crest::before,
.crest::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-left: 2px solid currentColor;
  left: 8px;
  transform: rotate(21deg);
}

.crest::after {
  left: 14px;
}

.nav {
  gap: clamp(14px, 2.2vw, 32px);
  font-size: 14px;
  font-weight: 700;
}

.nav a,
.footer-inner nav a {
  padding-block: 8px;
  white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current="page"],
.footer-inner nav a:hover,
.footer-inner nav a[aria-current="page"] {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.nav .booking {
  color: var(--blue);
  background: transparent;
  border: 1px solid rgba(32, 56, 119, 0.45);
  padding: 5px 13px;
  line-height: 1.4;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav .booking:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  text-decoration: none;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--blue);
}

.footer-inner {
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  padding-block: 24px;
}

.footer-inner nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
}

/* ── 共用編輯語彙：Kicker、純文字底線連結、線框行動控制項 ── */
.kicker,
.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.5;
  color: var(--blue);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.kicker::before {
  content: "";
  width: 28px;
  border-top: 1.5px solid currentColor;
}

.textlink,
.editorial-link {
  display: inline-block;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: rgba(32, 56, 119, 0.52);
  padding-block: 4px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.textlink:hover,
.editorial-link:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1.5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 22px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--blue);
  background: transparent;
  border: 1.5px solid var(--blue);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  background: var(--blue);
  color: #ffffff;
}

.links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.section {
  padding-block: clamp(48px, 5.2vw, 72px);
}

.tinted {
  background: var(--paper-tint);
  border-top: 1px solid rgba(44, 56, 75, 0.09);
}

/* ── 內頁刊頭與長目錄篩選台（文章目錄 ＆ Podcast 節目目錄共用） ── */
.interior {
  padding-block: clamp(38px, 4.4vw, 56px) clamp(20px, 2.4vw, 26px);
}

.interior p {
  margin-top: 10px;
  max-width: 34em;
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.75;
  color: var(--ink-sub);
}

.catalogue {
  padding-bottom: clamp(54px, 6vw, 84px);
}

.tools {
  border-top: 1px solid var(--rule-head);
  border-bottom: 1px solid var(--rule-soft);
  padding-block: 18px 18px;
  margin-bottom: 16px;
}

.tools .topic-choices {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}

.topic-choices legend {
  float: left;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--blue);
  padding: 4px 0;
  margin-right: 0;
  border-bottom: 2px solid transparent;
}

.topic-choices label {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.topic-choices input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.topic-choices span {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-sub);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.topic-choices label:hover span {
  color: var(--blue);
}

.topic-choices input:checked + span {
  color: var(--blue);
  font-weight: 700;
  border-bottom-color: var(--blue);
}

.topic-choices input:focus-visible + span {
  outline: 3px solid #b45412;
  outline-offset: 3px;
}

.filterline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.filterline label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--blue);
  flex: 1 1 260px;
  max-width: 420px;
}

.filterline input,
.filterline select {
  color: var(--ink);
  background: #fdfcf9;
  border: 1px solid var(--rule-mid);
  border-radius: 0;
  width: 100%;
  height: 42px;
  padding: 7px 12px;
  font-size: 15.5px;
  transition: border-color 0.15s ease;
}

.filterline input::placeholder {
  color: #707c88;
}

.filterline .compact-topic {
  display: none;
}

.catalogue-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.count {
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  margin: 0;
}

.inline-reset {
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.inline-reset:hover {
  color: var(--ink);
}

.empty {
  padding: 32px 0;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-sub);
}

.empty button {
  background: transparent;
  color: var(--blue);
  border: 0;
  padding: 4px 2px;
  margin-left: 6px;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 700;
  cursor: pointer;
}

/* ── 文章目錄單筆條目：左軸閱讀文字 ＋ 右側 16:9 完整比例縮圖 ── */
/* 使用 :not([hidden]) 通用兄弟選擇器，確保篩選後第一筆可見結果絕不多出一條頂線 */
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 28px;
  align-items: start;
  border-top: 0;
  padding: 12px 0 24px;
}

.entry:not([hidden]) ~ .entry:not([hidden]) {
  border-top: 1px solid var(--rule-soft);
  padding-top: 24px;
}

.entry > div {
  order: 1;
  min-width: 0;
}

.entry > img {
  order: 2;
  width: 156px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(30, 40, 56, 0.08);
  margin-top: 6px;
}

.entry .meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.entry .meta time {
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink-sub);
}

.entry .meta time::after {
  content: "·";
  margin-left: 10px;
  color: var(--rule-mid);
}

.entry :is(h2, h3) {
  font: 700 clamp(19.5px, 1.8vw, 23.5px)/1.38 var(--serif);
  letter-spacing: 0.015em;
  color: var(--blue);
  margin: 7px 0 8px;
  max-width: 42em;
}

.entry:hover :is(h2, h3) {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.entry p {
  font-size: 15.5px;
  line-height: 1.74;
  color: var(--ink-sub);
  max-width: 42em;
}

/* ── Podcast 節目目錄單筆條目（EPxx 光學對齊 h3 主標，96px 寬確保 EP61.9 單行） ── */
.episode {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px 28px;
  padding: 12px 0 22px;
  border-top: 0;
}

.episode:not([hidden]) ~ .episode:not([hidden]) {
  border-top: 1px solid var(--rule-soft);
  padding-top: 22px;
}

.epnum {
  padding-top: 21px;
  font: 700 21px/1.35 Georgia, serif;
  letter-spacing: 0.02em;
  color: var(--blue);
  white-space: nowrap;
}

.episode .meta {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.episode h3 {
  font: 700 clamp(19px, 1.75vw, 23.5px)/1.38 var(--serif);
  color: var(--show-blue, var(--blue));
}

.episode p {
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.68;
  color: var(--ink-sub);
}

.ep-links {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 22px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}

.ep-links a {
  padding-block: 4px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(32, 56, 119, 0.45);
  white-space: nowrap;
}

.ep-links a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1.5px;
}

/* ── 肖像框（關於我頁使用） ── */
.portrait {
  position: relative;
  padding: 0 14px 14px 0;
  isolation: isolate;
}

.portrait::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  top: 16px;
  bottom: 0;
  z-index: -1;
  background: #f6d477;
  border-top-left-radius: 96px;
}

.portrait img {
  width: 100%;
  height: clamp(300px, 29vw, 390px);
  object-fit: cover;
  object-position: center 20%;
  border-radius: 96px 0 0 0;
}

/* ── 響應式斷點：平板（<= 920px） ── */
@media (max-width: 920px) {
  .wrap {
    width: calc(100% - 56px);
  }
}

/* ── 響應式斷點：手機（<= 760px，啟用精簡主題下拉選單與搜尋並排） ── */
@media (max-width: 760px) {
  .catalogue:has(.compact-topic) .topic-choices {
    display: none;
  }

  .tools {
    padding-block: 14px;
    margin-bottom: 14px;
  }

  .filterline {
    display: grid;
    grid-template-columns: 1fr 1.14fr;
    gap: 10px 12px;
    align-items: end;
  }

  .filterline label,
  .filterline .compact-topic {
    display: grid;
    gap: 5px;
    max-width: none;
    min-width: 0;
  }

  .filterline input,
  .filterline select {
    height: 40px;
    padding: 6px 10px;
    font-size: 14.5px;
  }

  .filterline select {
    text-overflow: ellipsis;
  }
}

/* ── 響應式斷點：手機主體（<= 680px） ── */
@media (max-width: 680px) {
  .wrap {
    width: calc(100% - 36px);
  }

  .top-inner {
    display: block;
    padding-top: 14px;
  }

  .brand {
    font-size: 23px;
    gap: 10px;
  }

  .crest {
    width: 23px;
    height: 26px;
  }

  .nav {
    align-items: center;
    gap: 6px;
    justify-content: space-between;
    padding: 6px 0 10px;
    font-size: 13px;
  }

  .nav a {
    padding-block: 6px;
    text-underline-offset: 5px;
  }

  .nav .booking {
    padding: 4px 10px;
    font-size: 12.5px;
  }

  .section {
    padding-block: 40px 44px;
  }

  .interior {
    padding-block: 26px 16px;
  }

  .interior p {
    margin-top: 8px;
    font-size: 14.5px;
    line-height: 1.68;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr) 98px;
    gap: 12px;
    padding: 10px 0 18px;
  }

  .entry:not([hidden]) ~ .entry:not([hidden]) {
    padding-top: 18px;
  }

  .entry > img {
    width: 98px;
    aspect-ratio: 16 / 9;
    margin-top: 4px;
  }

  .entry .meta {
    font-size: 12px;
    gap: 2px 10px;
  }

  .entry .meta time::after {
    content: none;
  }

  .entry :is(h2, h3) {
    font-size: 18.5px;
    line-height: 1.38;
    margin: 5px 0 6px;
  }

  .entry p {
    font-size: 14px;
    line-height: 1.65;
  }

  .episode {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 6px 12px;
    padding: 10px 0 18px;
  }

  .episode:not([hidden]) ~ .episode:not([hidden]) {
    padding-top: 18px;
  }

  .epnum {
    padding-top: 19px;
    font-size: 18px;
  }

  .episode h3 {
    font-size: 18.5px;
  }

  .episode p {
    font-size: 14px;
  }

  .ep-links {
    grid-column: 2;
    justify-content: flex-start;
    padding-top: 2px;
    gap: 6px 16px;
  }

  .footer-inner nav {
    gap: 14px;
  }
}

/* ── 極窄與一般直向手機（<= 520px）：搜尋框與選主題單欄滿寬排列，確保 placeholder 與長主題名稱零截斷 ── */
@media (max-width: 520px) {
  .filterline {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ── 極窄視窗（<= 370px，含 320px 驗證寬度） ── */
@media (max-width: 370px) {
  .nav {
    font-size: 12px;
    gap: 4px;
  }

  .nav .booking {
    padding: 3px 6px;
    font-size: 11.5px;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 10px;
  }

  .entry > img {
    width: 76px;
  }

  .entry :is(h2, h3) {
    font-size: 17.5px;
  }

  .episode {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 4px 10px;
  }

  .epnum {
    padding-top: 18px;
    font-size: 17px;
  }
}
