:root {
    --paper: #f7f4ee;
    --card: #fffdf9;
    --ink: #2c2620;
    --ink-soft: #6b6259;
    --muted: #8d857a;
    --line: #e4ddd0;
    --accent: #9c3d2e;
    --accent-soft: #f3e7e2;
    --jade: #3f6b52;
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 249, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    font-family: "Songti SC", "STSong", Georgia, serif;
    font-size: 19px;
    letter-spacing: 2px;
    color: var(--ink);
    white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.brand small {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--muted);
    font-family: inherit;
    margin-top: -2px;
}

.top-search {
    flex: 1;
    display: flex;
    gap: 8px;
    max-width: 520px;
}

input[type=text], input[type=search] {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    transition: border-color .15s;
}

input[type=text]:focus, input[type=search]:focus {
    border-color: var(--accent);
}

button, .btn {
    padding: 9px 18px;
    border-radius: 22px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

button:hover { background: #85342a; }

.btn-ghost {
    background: transparent;
    color: var(--ink-soft);
    border-color: var(--line);
}

.btn-ghost:hover { background: #fff; color: var(--ink); }

.nav-links {
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.nav-links a { color: var(--ink-soft); }

main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.hero {
    text-align: center;
    padding: 40px 0 28px;
}

.hero h1 {
    font-family: "Songti SC", "STSong", Georgia, serif;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 6px;
    margin: 0 0 10px;
}

.hero p {
    color: var(--ink-soft);
    margin: 0 0 26px;
    font-size: 14px;
    letter-spacing: 1px;
}

.hero-search {
    display: flex;
    gap: 10px;
    max-width: 620px;
    margin: 0 auto;
}

.hero-search input {
    padding: 13px 20px;
    font-size: 15px;
    border-radius: 26px;
}

.hero-search button {
    padding: 13px 30px;
    border-radius: 26px;
    font-size: 15px;
}

.stat-strip {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 26px;
    color: var(--muted);
    font-size: 13px;
}

.stat-strip b {
    color: var(--ink);
    font-size: 20px;
    font-weight: 500;
    margin-right: 4px;
    font-family: Georgia, serif;
}

.section-title {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    margin: 38px 0 14px;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.section-title span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 0;
}

.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color .15s, transform .15s;
}

a.card { display: block; color: inherit; }

a.card:hover {
    text-decoration: none;
    border-color: #d3c7b4;
    transform: translateY(-1px);
}

.card .name {
    font-family: "Songti SC", "STSong", Georgia, serif;
    font-size: 16px;
    margin-bottom: 2px;
}

.card .count {
    font-size: 12px;
    color: var(--muted);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 5px 13px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 13px;
    color: var(--ink-soft);
}

.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 30px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 84px;
}

.filter-group { margin-bottom: 24px; }

.filter-group h3 {
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 500;
    margin: 0 0 8px;
    text-transform: none;
}

.filter-list { list-style: none; margin: 0; padding: 0; }

.filter-list li { margin-bottom: 2px; }

.filter-list a {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--ink-soft);
    font-size: 13.5px;
}

.filter-list a:hover { background: #fff; text-decoration: none; color: var(--ink); }

.filter-list a.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

.filter-list .n { color: var(--muted); font-size: 12px; }

.result-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 8px;
}

.result-head .sum { color: var(--ink-soft); font-size: 14px; }

.result-head .sum b { color: var(--accent); }

.sorts { display: flex; gap: 12px; font-size: 13px; }

.sorts a { color: var(--muted); }

.sorts a.active { color: var(--accent); font-weight: 500; }

.hit {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.hit h2 {
    font-size: 17px;
    font-weight: 400;
    margin: 0 0 4px;
    font-family: "Songti SC", "STSong", Georgia, serif;
}

.hit h2 a { color: var(--ink); }

.hit h2 a:hover { color: var(--accent); text-decoration: none; }

.hit .meta {
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 6px;
}

.hit .snippet {
    color: var(--ink-soft);
    font-family: "Songti SC", "STSong", Georgia, serif;
    font-size: 14.5px;
    line-height: 1.9;
}

.snippet em {
    font-style: normal;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0 2px;
    border-radius: 3px;
}

.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11.5px;
    line-height: 1.7;
    border: 1px solid;
}

.badge-complete { color: var(--jade); border-color: #cfe0d5; background: #eef5f0; }
.badge-suspect { color: #9a6b1f; border-color: #eadcbf; background: #fbf5e8; }
.badge-broken { color: var(--accent); border-color: #edcfc8; background: var(--accent-soft); }

.pager {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}

.pager a, .pager span {
    min-width: 34px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 13px;
    color: var(--ink-soft);
}

.pager .active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.work-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.work-head h1 {
    font-family: "Songti SC", "STSong", Georgia, serif;
    font-size: 27px;
    font-weight: 400;
    letter-spacing: 2px;
    margin: 0 0 8px;
}

.work-meta {
    color: var(--muted);
    font-size: 13px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.poem {
    font-family: "Songti SC", "STSong", Georgia, serif;
    font-size: 19px;
    line-height: 2.05;
    letter-spacing: 1px;
    padding: 10px 0 24px;
}

.poem .l { display: flex; gap: 18px; align-items: baseline; }

.poem .l .t { flex: 0 0 auto; }

.poem .l .s {
    color: #a89a86;
    font-size: 13px;
    letter-spacing: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.detail-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-top: 18px;
    font-size: 14px;
    color: var(--ink-soft);
}

.detail-block h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    margin: 0 0 8px;
    letter-spacing: 1px;
}

.kv { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 13px; }

.kv div b { color: var(--ink); font-weight: 500; }

.notice {
    background: #fbf5e8;
    border: 1px solid #eadcbf;
    color: #8a6320;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13.5px;
    margin-bottom: 18px;
}

.empty {
    text-align: center;
    padding: 60px 0;
    color: var(--muted);
}

.empty p { margin: 6px 0; }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 26px 20px 40px;
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.9;
}

.site-footer a { color: var(--muted); }

@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .header-inner { flex-wrap: wrap; gap: 10px; }
    .top-search { order: 3; width: 100%; max-width: none; }
    .hero h1 { font-size: 27px; }
    .stat-strip { gap: 20px; flex-wrap: wrap; }
}
