:root {
  color: #22231f;
  background: #f4f1e8;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1260px) / 2));
  border-bottom: 1px solid #d8d1c1;
  background: #fcfaf4;
}
.brand { color: #7d302b; font-size: 20px; font-weight: 700; letter-spacing: 0; text-decoration: none; }
.collection-count { color: #67685f; font-family: system-ui, sans-serif; font-size: 13px; }
main { max-width: 1260px; margin: 0 auto; padding: 34px 24px 48px; }
.search-band { border-bottom: 1px solid #d8d1c1; padding-bottom: 25px; }
.search-row { display: flex; gap: 10px; }
.search-input { flex: 1; }
input, select {
  width: 100%; height: 42px; border: 1px solid #bdb6a8; border-radius: 4px;
  background: #fffdf8; color: #22231f; outline: none; padding: 0 12px;
}
input:focus, select:focus { border-color: #7d302b; box-shadow: 0 0 0 2px #e9d6cc; }
.primary { height: 42px; min-width: 84px; border: 1px solid #6d2925; border-radius: 4px; background: #7d302b; color: #fffdf8; }
.primary:hover { background: #62251f; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.filters label { display: flex; align-items: center; gap: 8px; color: #53554e; font-family: system-ui, sans-serif; font-size: 13px; }
.filters select { width: 220px; height: 34px; }
.filters input { width: 190px; height: 34px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 38px; padding-top: 27px; }
.result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 18px; margin-bottom: 0; }
#result-count { color: #6f7069; font-family: system-ui, sans-serif; font-size: 13px; text-align: right; }
.results { display: grid; gap: 6px; }
.result-item {
  width: 100%; display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 3px 10px;
  padding: 14px 12px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: inherit; text-align: left;
}
.result-item:hover, .result-item.active { border-color: #d9c4b8; background: #fffaf1; }
.result-meta { grid-row: span 3; color: #8b6b52; font-family: system-ui, sans-serif; font-size: 12px; padding-top: 2px; }
.result-title { font-size: 16px; font-weight: 700; }
.result-author { color: #66675f; font-size: 13px; }
.result-preview { grid-column: 2 / -1; overflow: hidden; color: #55564f; font-size: 13px; line-height: 1.65; text-overflow: ellipsis; white-space: nowrap; }
.reader { min-height: 500px; border-left: 1px solid #d8d1c1; padding-left: 34px; }
.reader-empty, .status { color: #74756d; font-size: 14px; padding: 18px 0; }
.reader-meta { color: #8b6b52; font-family: system-ui, sans-serif; font-size: 13px; margin-bottom: 12px; }
.reader h2 { font-size: 25px; line-height: 1.35; margin-bottom: 7px; }
.reader-author { color: #66675f; font-size: 15px; }
.poem-body { margin-top: 27px; font-size: 17px; line-height: 2; white-space: pre-wrap; }
.file-path { margin-top: 28px; border-top: 1px solid #ddd6c8; color: #777870; font-family: system-ui, sans-serif; font-size: 12px; padding-top: 12px; word-break: break-all; }
.pagination { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 21px; font-family: system-ui, sans-serif; font-size: 13px; }
.pagination button { min-width: 66px; height: 32px; border: 1px solid #c7c0b2; border-radius: 4px; background: #fffdf8; color: #3e413b; }
.pagination button:not(:disabled):hover { border-color: #7d302b; color: #7d302b; }
.error { color: #9d3028; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 800px) {
  main { padding: 22px 16px 36px; }
  .topbar { padding: 0 16px; }
  .workspace { grid-template-columns: 1fr; gap: 25px; }
  .reader { min-height: auto; border-left: 0; border-top: 1px solid #d8d1c1; padding: 25px 0 0; }
  .result-item { grid-template-columns: 1fr auto; }
  .result-meta { grid-row: auto; }
  .result-preview { grid-column: 1 / -1; }
  .collection-count { max-width: 150px; text-align: right; }
}
