body {
    background-color: #121212;
    color: #d1d1d1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
}
*,
*::before,
*::after {
    box-sizing: border-box;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
h1 {
    font-size: 22px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.result-area {
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #333;
}
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
textarea#search_result {
    width: 100%;
    height: 80px;
    background-color: #0f0f0f;
    color: #fff;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    font-family: monospace;
}
.btn {
    background-color: #333;
    color: #eee;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn:hover {
    background-color: #555;
}
.btn-primary {
    background-color: #0056b3;
}
.btn-primary:hover {
    background-color: #007bff;
}
.btn-danger {
    background-color: #8f1616;
}
.btn-danger:hover {
    background-color: #b32020;
}
.field-group {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #333;
}
.field-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.field-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}
.scrollable-presets {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}
.scrollable-presets::-webkit-scrollbar {
    width: 5px;
}
.scrollable-presets::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}
.scrollable-presets::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.scrollable-presets::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.preset-btn {
    background-color: #2a2a2a;
    color: #d1d1d1;
    border: 1px solid #444;
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}
.preset-btn:hover {
    background-color: #3a3a3a;
    border-color: #666;
}
.preset-btn.active {
    background-color: #0056b3;
    border-color: #007bff;
    color: #fff;
}
.field-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}
.field-controls input {
    background-color: #0f0f0f;
    border: 1px solid #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    flex: 1 1 auto;
    min-width: 120px;
    height: 34px;
    width: 100%;
}
.field-controls input:focus {
    outline: none;
    border-color: #007bff;
}
.field-controls .btn {
    flex-shrink: 0;
    height: 34px;
}
.divider {
    height: 1px;
    background-color: #333;
    margin: 15px 0 5px 0;
}
.search-filter {
    margin-bottom: 6px;
}
.search-filter input {
    width: 100%;
    box-sizing: border-box;
    background-color: #0f0f0f;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    height: 34px;
    font-size: 13px;
}
.search-filter input:focus {
    outline: none;
    border-color: #007bff;
}
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #2a2a2a;
    color: #eee;
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid #444;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 999;
}
.toast.show {
    opacity: 1;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}
.page-btn {
    background: #2a2a2a;
    color: #eee;
    border: 1px solid #444;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.page-btn:hover:not(:disabled) {
    background: #3a3a3a;
}
.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.page-info {
    font-size: 13px;
    color: #aaa;
    min-width: 55px;
    text-align: center;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .field-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .field-controls input {
        width: 100%;
        flex: unset;
        min-width: unset;
    }
    .field-controls .btn {
        width: 100%;
        height: 40px;
    }
    .search-filter input {
        height: 40px;
    }
    .preset-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .scrollable-presets {
        max-height: 130px;
    }
}
