* { box-sizing: border-box; }
body {
    margin: 0;
    background: #f5f6f8;
    color: #222;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
header {
    padding: 18px 20px;
    background: #292d32;
    color: white;
    font-size: 18px;
    font-weight: 600;
}
main {
    max-width: 900px;
    margin: 28px auto;
    padding: 0 16px;
}
.search-panel {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
input, select, button {
    min-height: 42px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 15px;
}
input { flex: 1; min-width: 0; }
button {
    background: #333b45;
    color: white;
    border: 0;
    cursor: pointer;
}
select { background: white; }
#status { color: #666; margin: 18px 0; }
.month-group { margin-top: 26px; }
.month-group h2 {
    font-size: 17px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}
.result {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 7px;
    padding: 14px 16px;
    margin: 10px 0;
}
.result-title {
    color: #1769aa;
    font-weight: 600;
    text-decoration: none;
}
.result-title:hover { text-decoration: underline; }
.result-meta {
    color: #888;
    font-size: 13px;
    margin-top: 5px;
}
.excerpt {
    color: #444;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 9px;
    overflow-wrap: anywhere;
}
mark { background: #fff0a8; }
@media (max-width: 600px) {
    main {
        margin: 16px auto;
        padding: 0 12px;
    }

    header {
        padding: 15px 14px;
    }

    .search-panel {
        flex-wrap: wrap;
        gap: 8px;
    }

    input {
        flex-basis: 100%;
    }

    select {
        flex: 1;
        min-width: 0;
    }

    button {
        min-width: 76px;
    }

    .result {
        padding: 12px;
    }

    .result-title {
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

    .excerpt {
        line-height: 1.6;
    }
}
@media (prefers-color-scheme: dark) {
    body {
        background: #111418;
        color: #e5e7eb;
    }

    header {
        background: #20262e;
        color: #f1f3f5;
    }

    input, select {
        background: #1b2027;
        color: #e5e7eb;
        border-color: #454e59;
    }

    button {
        background: #394553;
        color: #fff;
    }

    #status {
        color: #aab4c0;
    }

    .month-group h2 {
        border-color: #39414b;
        color: #e5e7eb;
    }

    .result {
        background: #1b2027;
        border-color: #343d48;
    }

    .result-title {
        color: #8ab4f8;
    }

    .result-meta {
        color: #9ba6b2;
    }

    .excerpt {
        color: #c5cbd3;
    }

    mark {
        background: #66551a;
        color: #fff0b3;
    }
}
