* { box-sizing: border-box }
:root { --ink: #162e34; --muted: #526a68; --line: #d2d7cd; --paper: #fffef9; --teal: #184644 }
body { margin: 0; color: var(--ink); background: #f5f3eb; font: 16px/1.6 "Microsoft YaHei", sans-serif }
.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto }
header { background: #102d34; color: #fbf6e6; padding: 22px 0 27px; border-bottom: 3px solid #bc9959 }
header a { color: #c2dcd4; font-size: .875rem; text-underline-offset: 4px }
h1,h2 { font-family: "Noto Serif SC", SimSun, serif; line-height: 1.2 }
h1 { margin: 16px 0 6px; font-size: clamp(2rem,4vw,3rem) }
header p { margin: 0; color: #d5e0da }
input,select,button { font: inherit; color: inherit }
button,input,select { border: 1px solid var(--line); border-radius: 4px; background: var(--paper) }
button { cursor: pointer; padding: 7px 14px }
button:disabled { opacity: .52; cursor: default }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline: 3px solid #987028; outline-offset: 2px }
button[aria-pressed=true] { color: white; border-color: var(--teal); background: var(--teal) }
.filters { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)) auto; gap: 12px; align-items: end; margin-top: 24px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px }
.filters label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: .8rem; font-weight: 600 }
.filters label:first-child { grid-column: span 4 }
.filters label:nth-child(2) { grid-column: span 2 }
input,select,#clear { width: 100%; height: 40px; min-width: 0; padding: 0 10px; color: var(--ink); font-size: .9rem; font-weight: 400 }
#count { margin: 18px 0 10px; color: var(--muted); font-size: .85rem }
#grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr)); gap: 14px }
.card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; overflow: hidden; text-align: left; background: var(--paper) }
.card:hover { border-color: #738f80 }
.card img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #e7e8dd }
.card strong { margin: 9px 10px 7px; line-height: 1.4; overflow-wrap: anywhere }
.card small { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; margin: auto 10px 10px; color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums }
.card small span { white-space: nowrap }
.card small span:first-child { margin-right: auto }
nav,figcaption,#portraits { display: flex; align-items: center; justify-content: center; gap: 8px }
nav { margin: 24px 0 40px }
#page { min-width: 68px; text-align: center; font-variant-numeric: tabular-nums }
dialog { width: min(940px,94vw); max-height: 90vh; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink) }
dialog::backdrop { background: #07181bd9 }
.detailHead { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px }
.detailHead form { flex: none }
.detailHead small,.skill small,#credit { color: var(--muted) }
h2 { margin: 4px 0 14px; font-size: clamp(1.45rem,3vw,2rem) }
h3 { margin: 16px 0 5px; line-height: 1.4 }
.detail { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,3fr); gap: 24px }
.detail[hidden],#loading:empty { display: none }
figure { margin: 0 }
#full { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: #eaebe2; cursor: zoom-in }
#full img { display: block; width: 100%; height: min(54vh,450px); object-fit: contain }
#full.cropped { display: block; position: relative; overflow: hidden; aspect-ratio: var(--crop-ratio); border: 0; border-radius: 0; background: transparent }
#full.cropped img { position: absolute; left: var(--image-left); top: var(--image-top); width: var(--image-width); height: auto; max-width: none }
figcaption,#portraits { flex-wrap: wrap; margin-top: 8px }
figure button { padding: 6px 10px; font-size: .84rem }
.skill { background: #edf2ea; padding: 12px 16px; border-left: 3px solid #597b67; margin-bottom: 18px }
.skill h3,.skill p { margin: 4px 0 }
article p { white-space: pre-line; overflow-wrap: anywhere }
#bio { margin: 4px 0 0; line-height: 1.85 }
#credit { font-size: .85rem }
table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums }
caption { text-align: left; font-size: 1rem; font-weight: bold }
td,th { border-bottom: 1px solid var(--line); padding: 8px 3px; text-align: left }
@media(max-width:700px) {
  .wrap { width: calc(100% - 28px) }
  header { padding: 17px 0 20px }
  .filters { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 14px; padding: 12px }
  .filters label:first-child { grid-column: span 2 }
  .filters label:nth-child(2) { grid-column: auto }
  #grid { grid-template-columns: repeat(auto-fill,minmax(min(130px,44%),1fr)); gap: 10px }
  dialog { padding: 15px; max-height: 94dvh }
  .detail { grid-template-columns: 1fr; gap: 17px }
  #full img { height: min(35vh,280px) }
}
