* { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; }
body {
  font-family: "Songti SC","STSong","Noto Serif SC","SimSun","KaiTi",serif;
  background: #f8f6f0;
  color: #3a3a3a;
  line-height: 1.8;
  min-height: 100vh;
}
a { color: #8b5a2b; text-decoration: none; }
a:hover { color: #c78a4a; }

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid #e8e0d0;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.header-inner h1 { font-size: 22px; font-weight: 700; white-space: nowrap; }
.header-inner h1 a { color: #3a3a3a; }
.header-inner h1 a:hover { color: #8b5a2b; }

/* ── Search Box ── */
.search-box { display:flex; flex:1; max-width:360px; gap:4px; }
.search-box input {
  flex:1; padding:7px 12px; border:1px solid #ddd; border-radius:20px;
  font-size:14px; font-family:inherit; background:#f5f3ef; outline:none;
  transition:border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color:#c78a4a; background:#fff; box-shadow:0 0 0 2px rgba(199,138,74,0.15); }
.search-box button {
  padding:6px 14px; border:1px solid #ddd; border-radius:20px;
  background:#f5f3ef; cursor:pointer; font-size:14px; color:#666;
  transition:all .2s;
}
.search-box button:hover { background:#e8e0d0; border-color:#c78a4a; }

/* ── Main ── */
main { max-width:860px; margin:0 auto; padding:28px 20px 50px; min-height:calc(100vh - 130px); }

/* ── Loading / Empty / Error ── */
.loading, .empty, .error { text-align:center; padding:60px 20px; color:#999; font-size:15px; }
.error { color:#c0392b; }

/* ── Breadcrumb ── */
.breadcrumb { font-size:13px; color:#999; margin-bottom:18px; }
.breadcrumb .count { font-size:12px; color:#bbb; }

/* ── Collection Grid ── */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.collection-card {
  background: #fff;
  border: 1px solid #e8e0d0;
  border-radius: 8px;
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.collection-card:hover {
  border-color: #c78a4a;
  box-shadow: 0 2px 12px rgba(139,90,43,0.1);
  transform: translateY(-1px);
}
.collection-card h2 { font-size:15px; font-weight:700; color:#3a3a3a; margin-bottom:4px; }
.collection-card p { font-size:12px; color:#999; margin-bottom:6px; }
.collection-card .count { font-size:11px; color:#bbb; }

/* ── Poem List ── */
.poem-list ol { list-style:none; }
.poem-list li {
  padding:10px 14px; border-bottom:1px solid #eee;
  cursor:pointer; display:flex; flex-wrap:wrap; align-items:baseline; gap:6px;
  transition:background .12s;
}
.poem-list li:hover { background:#faf8f4; }
.poem-list li .title { font-size:14px; font-weight:600; color:#2c2c2c; }
.poem-list li .author { font-size:12px; color:#999; }
.poem-list li .source { font-size:11px; color:#bbb; background:#f0ede8; padding:1px 6px; border-radius:3px; }
.poem-list li .preview { font-size:12px; color:#ccc; flex:1; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── Search Result ── */
.search-result-header { font-size:14px; color:#666; margin-bottom:14px; padding:8px 0; border-bottom:1px solid #eee; }

/* ── Poem Detail ── */
.poem-detail {
  background:#fff; border:1px solid #e8e0d0; border-radius:8px; padding:28px 32px;
}
.poem-detail .poem-title { font-size:22px; font-weight:700; text-align:center; margin-bottom:2px; color:#2c2c2c; }
.poem-detail .poem-author { text-align:center; font-size:13px; color:#999; margin-bottom:24px; }
.poem-text { font-size:16px; line-height:2.2; text-align:center; }
.poem-text p { margin-bottom:1px; }
.poem-notes { margin-top:24px; padding-top:16px; border-top:1px solid #eee; }
.notes-body { font-size:13px; color:#777; line-height:1.7; text-align:left; }

/* ── Footer ── */
footer { text-align:center; padding:16px; font-size:12px; color:#ccc; border-top:1px solid #eee; }
footer a { color:#bbb; }
footer a:hover { color:#8b5a2b; }

/* ── Responsive ── */
@media (max-width:640px) {
  header { padding:12px 14px; }
  .header-inner h1 { font-size:18px; }
  .search-box { max-width:100%; }
  main { padding:16px 10px 36px; }
  .collection-grid { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
  .poem-detail { padding:18px 14px; }
  .poem-detail .poem-title { font-size:19px; }
  .poem-text { font-size:15px; }
}
