* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: #667eea;
}

#searchBtn {
    padding: 14px 32px;
    font-size: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.filters {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.filters input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.status {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px 18px;
    border-left: 4px solid #667eea;
}

.result-item.物理 {
    border-left-color: #3498db;
}

.result-item.化学 {
    border-left-color: #e74c3c;
}

.result-item.生物 {
    border-left-color: #27ae60;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.result-title {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.result-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.result-badge.物理 {
    background: #3498db;
}

.result-badge.化学 {
    background: #e74c3c;
}

.result-badge.生物 {
    background: #27ae60;
}

.hit-count {
    color: #888;
    font-size: 12px;
    margin-left: auto;
}

.hits-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hit-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.hit-page {
    flex-shrink: 0;
    width: 45px;
    color: #667eea;
    font-weight: bold;
    font-size: 12px;
}

.hit-text {
    color: #555;
    flex: 1;
}

.hit-text mark {
    background: #fff3cd;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .search-box {
        flex-direction: column;
    }

    .filters {
        flex-wrap: wrap;
    }
}
