:root {
    --blue: #08b8dc;
    --blue-dark: #188fbd;
    --green: #19ad58;
    --red: #ef302b;
    --line: #d8e0e5;
    --text: #52606b;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--text);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    font-size: 13px;
    background: #f3f7f7 url('/static/index/money-bg.svg') center top / 920px auto repeat;
}

.topbar {
    height: 44px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(180deg, #258caf, #167a9c);
    border-bottom: 3px solid #0eb9db;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
}

.brand { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.brand-mark { margin-right: 7px; color: #7ee8fb; }
.topbar-tip { opacity: .88; font-size: 12px; }

.workbench {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr) minmax(420px, 1fr);
    gap: 22px;
    align-items: start;
    padding: 14px 10px 28px;
}

.panel {
    background: rgba(255, 255, 255, .96);
    border: 1px solid #d6dce0;
    border-top-width: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .16);
}

.panel-query { border-top-color: var(--blue); }
.panel-existing { border-top-color: var(--green); }
.panel-missing { border-top-color: var(--red); }

.panel-head {
    min-height: 43px;
    padding: 8px 9px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #eef1f3;
}

.panel-head h2 {
    margin: 0;
    font-size: 17px;
    line-height: 26px;
    color: var(--blue);
}

.panel-existing .panel-head h2 { color: #078b19; }
.panel-missing .panel-head h2 { color: #f11616; }
.panel-head h2 span { margin-left: 4px; }

.query-content { padding: 0 8px 14px; }

#queryList {
    display: block;
    width: 100%;
    height: 338px;
    padding: 10px 11px;
    color: #65727b;
    font: 13px/1.65 Consolas, "Microsoft YaHei", monospace;
    resize: vertical;
    outline: none;
    background: #fff;
    border: 1px solid #cdd7dd;
    transition: border-color .16s, box-shadow .16s;
}

#queryList:focus {
    border-color: #21afe0;
    box-shadow: 0 0 0 2px rgba(33, 175, 224, .12);
}

.query-actions { padding: 9px 0 6px; text-align: center; }

.btn {
    appearance: none;
    padding: 7px 13px;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    border: 0;
    border-radius: 3px;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .09);
}

.btn:hover:not(:disabled) { filter: brightness(.95); }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn-primary { background: #2196ed; }
.btn-info { background: #42bdd8; }
.btn-success { background: #55b957; }
.btn-sm { padding: 6px 10px; white-space: nowrap; }

.query-summary { color: #248f35; text-align: center; line-height: 20px; }

.format-tip {
    margin-top: 16px;
    padding: 14px 16px;
    color: #fff;
    font-weight: 600;
    line-height: 1.65;
    background: #08b7db;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
}

.format-tip span { margin-left: 18px; }

.table-toolbar {
    min-height: 48px;
    padding: 10px;
    display: flex;
    justify-content: flex-end;
}

.icon-button {
    min-width: 42px;
    height: 30px;
    color: #2f3f49;
    cursor: pointer;
    background: #fff;
    border: 1px solid #cfd7dc;
    border-radius: 3px;
}

.icon-button:disabled { cursor: not-allowed; opacity: .45; }
.icon-button small { font-size: 9px; }
.table-wrap { overflow: auto; border-top: 1px solid #edf0f2; }

table { width: 100%; border-collapse: collapse; table-layout: fixed; }

th, td {
    height: 43px;
    padding: 0;
    text-align: left;
    vertical-align: middle;
    border: 1px solid #dfe6ea;
}

th {
    padding: 0 10px;
    color: #53616b;
    font-weight: 500;
    background: #f7f9fa;
}

td input {
    width: 100%;
    height: 42px;
    padding: 0 9px;
    color: #63717c;
    font: inherit;
    outline: 0;
    background: transparent;
    border: 0;
}

td input:focus { background: #effaff; box-shadow: inset 0 0 0 1px #27afd3; }

.empty-row td {
    height: 34px;
    color: #87929a;
    text-align: center;
    background: #fff;
}

.table-footer { min-height: 35px; padding: 9px 10px; color: #333; }

.busy-layer {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    background: rgba(24, 43, 52, .44);
}

.busy-layer.show { display: flex; }
.busy-layer p { margin: 12px 0 0; }

.spinner {
    width: 38px;
    height: 38px;
    border: 4px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    z-index: 1100;
    left: 50%;
    bottom: 32px;
    max-width: min(520px, calc(100vw - 32px));
    padding: 10px 18px;
    color: #fff;
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 12px);
    background: rgba(31, 45, 54, .94);
    border-radius: 4px;
    transition: .2s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: rgba(202, 48, 48, .95); }

@media (max-width: 1380px) {
    .workbench { grid-template-columns: 1fr; }
    #queryList { height: 260px; }
}

@media (max-width: 640px) {
    .topbar { height: auto; min-height: 44px; }
    .topbar-tip { display: none; }
    .workbench { padding: 10px 7px 24px; gap: 14px; }
    .panel-head { flex-wrap: wrap; }
    .format-tip span { display: block; margin: 5px 0 0; }
    .table-wrap { overflow-x: auto; }
    table { min-width: 700px; }
    .panel-missing table { min-width: 560px; }
}
