body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

* {
    box-sizing: border-box;
}

.page-shell {
    min-height: 100vh;
    padding: 32px 16px;
}

.page-shell.query-center {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.page-shell.narrow {
    max-width: 760px;
    margin: 0 auto;
}

.page-shell.wide {
    max-width: 1280px;
    margin: 0 auto;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.query-card {
    width: min(100%, 560px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    margin-top: 0;
    margin-bottom: 8px;
}

.muted {
    color: #6b7280;
    margin-top: 0;
}

.form-grid {
    display: grid;
    gap: 16px;
    margin: 24px 0;
}

.form-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
}

button {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

button.secondary {
    background: #6b7280;
}

.message {
    min-height: 24px;
    color: #dc2626;
}

.hidden {
    display: none;
}

.link {
    color: #2563eb;
    text-decoration: none;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
}

.toolbar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: end;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
}

.result-item {
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    margin-top: 12px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

#query-form-section,
#query-result-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#query-form-section.hidden,
#query-result-section.hidden {
    display: none;
}

.actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .card {
        padding: 16px;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}
