:root {
    color-scheme: light;
    --ink: #202a37;
    --muted: #7d8795;
    --line: #e8ecf0;
    --accent: #167d69;
    --accent-dark: #0f6655;
    --accent-soft: #eaf5f0;
    --surface: #f7f8fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--surface); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #8fcebc; outline-offset: 4px; }
button, a, textarea { transition: background .18s, border-color .18s, box-shadow .18s, color .18s; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }
body:not([data-auth=ready]) > .sidebar, body:not([data-auth=ready]) > .app-shell { display: none; }
body[data-auth=ready] > .auth-screen { display: none; }
.auth-screen { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fcfdfc; }
.auth-intro { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 8vw; background: linear-gradient(145deg, #eaf4ef, #f3f8f5 66%, #e2eee7); }
.auth-wordmark { position: absolute; top: 48px; font-size: 26px; letter-spacing: -.7px; }.auth-wordmark strong { color: var(--accent); }
.auth-intro .eyebrow { color: #54806a; font-size: 11px; letter-spacing: 2px; }.auth-intro h1 { font-size: clamp(30px, 3.3vw, 50px); line-height: 1.5; margin: 20px 0; letter-spacing: -1px; }
.auth-intro > p:not(.eyebrow) { color: #6e8477; line-height: 2; font-size: 15px; }.auth-intro-footer { position: absolute; bottom: 48px; font-size: 12px; color: #6c8a77; }.auth-intro-footer span { margin: 0 12px; }
.auth-card { width: min(390px, calc(100% - 40px)); margin: auto; padding: 42px 0; }.auth-card-mark { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 12px; background: var(--accent); color: white; font-size: 18px; font-weight: 700; }
.auth-card h2 { font-size: 26px; margin: 25px 0 10px; }.auth-card > p { color: #829087; font-size: 14px; line-height: 1.8; }
.auth-card form, .account-form-dialog form, .account-editor-form, .data-grant-form { display: grid; gap: 17px; }
.auth-card form { margin-top: 28px; }.auth-card label, .account-form-dialog label, .account-editor-form label { display: grid; gap: 8px; font-size: 13px; color: #4a6052; }
.auth-card input, .account-form-dialog input, .account-form-dialog select, .account-editor-form input, .account-editor-form select, .account-editor-form textarea { width: 100%; min-width: 0; background: #fff; border: 1px solid #dce6df; border-radius: 7px; padding: 11px 12px; font: inherit; color: var(--ink); }
.auth-card input:focus-visible, .account-editor-form :is(input,select,textarea):focus-visible { outline: 3px solid #a7d5c5; outline-offset: 1px; }
.auth-card .primary-button { justify-content: center; padding: 13px; }.auth-note { font-size: 12px; line-height: 1.9; color: #839287; margin: 0; }
.auth-message, .admin-status.error { color: #ad6043 !important; font-size: 13px; line-height: 1.8; background: #fff7f0; border-radius: 7px; padding: 11px 13px; overflow-wrap: anywhere; }.auth-card > .auth-message { margin-top: 20px; }
.topbar-account { display: flex; align-items: center; gap: 24px; min-width: 0; }.account-menu { position: relative; }.account-menu > summary { list-style: none; display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }.account-menu > summary::-webkit-details-marker { display: none; }
.user-avatar { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #e7f2eb; color: #37785a; border-radius: 50%; font-weight: 600; }
#currentUserName { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.account-menu-content { position: absolute; z-index: 25; top: 44px; right: 0; width: 180px; padding: 10px; border: 1px solid #e0e9e4; border-radius: 10px; background: #fff; box-shadow: 0 10px 28px #1e3c2a14; }
.account-menu-content span { display: block; padding: 8px; font-size: 11px; color: #8c9c90; }.account-menu-content button { display: block; width: 100%; background: none; border: none; border-radius: 6px; padding: 10px; text-align: left; font: inherit; font-size: 13px; }.account-menu-content button:hover { background: #f0f7f2; }
.admin-workspace { max-width: 1320px; padding: 42px 50px; margin: 0 auto; }.admin-notice { border: 1px solid #dceae2; padding: 14px 18px; background: #f2f8f5; color: #67816f; border-radius: 8px; font-size: 13px; line-height: 1.9; }
.admin-status { margin: 16px 0; font-size: 13px; color: #7b8d80; }.admin-status:empty { display: none; }.users-layout { display: grid; grid-template-columns: minmax(250px,.8fr) minmax(350px,1.4fr); align-items: start; gap: 22px; margin-top: 24px; }
.users-list-panel, .user-editor-panel { padding: 23px; border: 1px solid #e0e9e3; background: #fff; border-radius: 11px; min-width: 0; }.users-list-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }.users-list-heading h2, .user-editor-panel h2 { font-size: 17px; margin: 0; }
.user-list-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; grid-template-rows: auto auto; gap: 4px 10px; width: 100%; padding: 13px 9px; border: 1px solid transparent; border-bottom-color: #edf2ee; background: white; border-radius: 7px; text-align: left; }.user-list-item.selected { background: #f0f7f3; border-color: #d5e8db; }.user-list-item .user-avatar { grid-row: span 2; align-self: center; }.user-list-item .user-list-name { font-size: 13px; overflow-wrap: anywhere; }.user-list-item small { grid-column: 2; color: #8c9b90; font-size: 11px; overflow-wrap: anywhere; }
.user-status { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-size: 11px; color: #5b9472; }.user-status.disabled { color: #a28a7a; }.users-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 8px; font-size: 11px; color: #8b9a8e; }.users-pagination button { font-size: 11px; padding: 7px 10px; }
.account-editor-form { padding-top: 23px; margin-top: 23px; border-top: 1px solid #edf1ee; }.account-editor-form h3 { font-size: 14px; margin: 0; }.account-editor-form .primary-button, .account-editor-form .secondary-button { justify-self: start; }.data-grant-form { padding: 17px; border: 1px solid #e1ebe5; border-radius: 8px; }.data-grant-form h4 { margin: 0; font-size: 13px; }.grant-state { font-size: 12px; color: #71947c; margin: 0; }.grant-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.user-editor-panel h2 { overflow-wrap: anywhere; }
.danger-button { color: #a35c48; border: 1px solid #ecd7cd; border-radius: 6px; padding: 9px 14px; background: #fffaf7; font-size: 12px; }.account-form-dialog { width: min(490px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; }
@media (max-width: 1000px) { .users-layout { grid-template-columns: 1fr; }.admin-workspace { padding: 30px; }.auth-intro { padding: 5vw; }.topbar-account { gap: 13px; } }
@media (max-width: 720px) { .auth-screen { grid-template-columns: 1fr; }.auth-intro { display: none; }.auth-card { max-width: 390px; }.topbar-account .workspace-badge { display: none; }.topbar-account { gap: 8px; }#currentUserName { max-width: 90px; }.admin-workspace { padding: 25px 17px; }.users-list-panel, .user-editor-panel { padding: 17px; }.admin-workspace .page-heading { gap: 12px; flex-wrap: wrap; } }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 32px 18px 20px; background: #fdfdfd; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px; font-size: 23px; font-weight: 650; letter-spacing: -.8px; }
.brand strong { color: var(--accent); font-weight: 750; }
.brand small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 1.5px; margin-top: 5px; }
.brand-mark { display: flex; align-items: end; justify-content: center; gap: 4px; width: 36px; height: 38px; border-radius: 10px; padding: 10px 8px; background: var(--accent); box-shadow: 0 4px 10px #167d6914; }
.brand-mark i { background: white; width: 4px; border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 8px; opacity: .65; }
.brand-mark i:nth-child(2) { height: 13px; opacity: .85; }
.brand-mark i:nth-child(3) { height: 19px; }
.new-query-button { margin: 34px 6px 30px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #dbe9e3; background: #f1f8f4; color: #26735f; border-radius: 9px; font-size: 14px; font-weight: 600; }
.new-query-button:hover { background: #e4f1eb; }
.shortcut { margin-left: auto; font-size: 16px; color: #91afa2; }
.sidebar-label { font-size: 12px; color: #929ba6; letter-spacing: 1px; padding: 0 15px; }
.nav-item { display: flex; align-items: center; gap: 11px; margin-top: 12px; padding: 12px 14px; font-size: 14px; border-radius: 8px; }
.nav-item.active { background: var(--accent-soft); color: #146d59; font-weight: 600; }
.mobile-workspace-navigation { display: none; }
.nav-dot { width: 5px; height: 5px; border-radius: 100%; background: var(--accent); margin-left: auto; }
.history-heading { margin-top: 35px; display: flex; justify-content: space-between; align-items: center; padding-right: 12px; }
.text-button { padding: 3px 1px; background: none; border: none; color: #87929c; font-size: 12px; }
.text-button:hover { color: var(--accent); }
.text-button:disabled { opacity: .4; }
.history-empty { margin: 19px 15px; font-size: 12px; color: #a4acb6; line-height: 1.8; }
.query-history { margin-top: 10px; overflow: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.history-item { display: flex; align-items: center; width: 100%; gap: 9px; padding: 11px 14px; border: 0; background: transparent; border-radius: 7px; text-align: left; color: #697684; font-size: 13px; }
.history-item .icon { width: 15px; height: 15px; color: #98a2ad; }
.history-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item:hover, .history-item.selected { background: #f1f4f5; color: var(--ink); }
.sidebar-footer { margin: auto 8px 0; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; font-size: 12px; color: #65717d; }
.sidebar-footer small { display: block; color: #a2aab3; font-size: 11px; margin-top: 5px; }
.footer-symbol { background: #eef1f3; width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #7f8c96; }
.app-shell { margin-left: 232px; min-height: 100vh; }
.topbar { height: 68px; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #ffffffb8; }
.breadcrumb { display: flex; align-items: center; gap: 15px; font-size: 12px; color: #929ba6; }
.breadcrumb strong { font-weight: 500; color: #4b5867; }
.breadcrumb-divider { color: #c7cdd4; }
.workspace-badge { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #8b959f; }
.workspace-badge .icon { width: 15px; height: 15px; }
.workspace { max-width: 1152px; padding: 35px 48px 28px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-heading h1 { font-size: 23px; margin: 0; font-weight: 650; letter-spacing: -.7px; }
.page-heading p { font-size: 13px; margin: 9px 0 0; color: #8c95a0; }
.page-tag { padding: 6px 10px; color: #7d8993; border: 1px solid #e0e6eb; border-radius: 5px; background: #ffffff85; font-size: 12px; white-space: nowrap; }
.welcome { text-align: center; padding: 27px 0 34px; }
.welcome-symbol { display: inline-grid; place-items: center; width: 53px; height: 53px; border: 1px solid #dfebe6; border-radius: 17px; color: var(--accent); background: linear-gradient(145deg,#fff,#edf6f0); box-shadow: 0 8px 18px #164c3910; transform: rotate(-7deg); }
.welcome-symbol .icon { width: 26px; height: 26px; transform: rotate(7deg); }
.eyebrow { color: #94a39d; font-size: 11px; letter-spacing: 2.4px; margin-top: 22px; }
.welcome h2 { font-size: clamp(22px,2.2vw,30px); font-weight: 600; letter-spacing: -.8px; margin: 13px 0; }
.welcome p { font-size: 13px; line-height: 1.9; color: #7e8a96; margin: 0; }
.mobile-break { display: none; }
.query-composer { position: relative; background: white; border: 1px solid #e0e6e7; border-radius: 14px; padding: 20px 21px 16px; box-shadow: 0 4px 22px #263e3a05, 0 1px 2px #263e3a03; }
.query-composer:focus-within { border-color: #8ab8a8; box-shadow: 0 0 0 3px #167d6908,0 5px 22px #263e3a05; }
.composer-label { color: #78858d; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.composer-label .icon { width: 16px; height: 16px; color: #91a19b; }
textarea { width: 100%; min-height: 84px; max-height: 240px; display: block; border: 0; resize: vertical; outline: none; padding: 17px 0 10px; color: var(--ink); background: transparent; font-size: 14px; line-height: 1.8; }
textarea::placeholder { color: #98a3ae; font-size: 14px; }
textarea:disabled { opacity: .65; resize: none; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 13px; border-top: 1px solid #f0f2f4; }
.input-hint { color: #87949e; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.input-hint .icon { width: 13px; height: 13px; }
.composer-actions { display: flex; align-items: center; gap: 16px; }
.keyboard-hint { font-size: 11px; color: #a9b0b8; }
.primary-button { display: flex; align-items: center; gap: 12px; background: var(--accent); color: white; border: 1px solid var(--accent); padding: 9px 14px; min-height: 37px; border-radius: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.primary-button .icon { width: 16px; height: 16px; }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.primary-button:disabled { background: #a9c7bb; border-color: #a9c7bb; opacity: .8; }
.primary-button.cancel { background: #fff7f5; color: #b3614e; border-color: #efd4ca; }
.primary-button.cancel:hover { background: #ffede7; }
.stop-symbol { display: inline-block; width: 9px; height: 9px; background: currentColor; border-radius: 2px; }
.suggestions { margin-top: 27px; }
.suggestions-heading { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: #909aa5; margin-bottom: 13px; }
.suggestions-heading span:last-child { color: #adb5bd; font-size: 11px; }
.suggestion-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.suggestion-card { position: relative; text-align: left; padding: 17px; border: 1px solid #e5e9ed; background: #ffffffa6; border-radius: 10px; min-height: 129px; }
.suggestion-card:hover { border-color: #b6d3c5; background: white; box-shadow: 0 5px 16px #243c3310; }
.suggestion-icon { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; margin-bottom: 11px; }
.suggestion-icon .icon { width: 16px; height: 16px; }
.green { background: #ecf4ef; color: #57917b; }
.blue { background: #ecf0f8; color: #6f8ebc; }
.amber { background: #f8f0e5; color: #b99766; }
.suggestion-category { display: block; font-size: 12px; font-weight: 600; color: #65727f; margin-bottom: 7px; }
.suggestion-question { display: block; font-size: 12px; color: #929ca6; line-height: 1.7; padding-right: 10px; }
.suggestion-arrow { position: absolute; width: 14px; height: 14px; right: 15px; top: 23px; color: #b7c1c5; }
.query-results { display: flex; flex-direction: column; gap: 22px; margin-top: 25px; }
.query-results:empty { display: none; }
.chat-card { background: white; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; scroll-margin-top: 24px; box-shadow: 0 3px 10px #263e3a03; }
.question-row { display: flex; align-items: flex-start; gap: 12px; padding: 20px 23px 17px; border-bottom: 1px solid #f0f2f4; }
.q-icon { width: 30px; height: 30px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; border-radius: 8px; flex-shrink: 0; }
.q-icon .icon { width: 17px; height: 17px; }
.q-text { flex: 1; min-width: 0; margin: 4px 0 0; font-size: 14px; font-weight: 550; line-height: 1.6; overflow-wrap: anywhere; }
.q-time { font-size: 12px; color: #a0a9b3; margin-top: 7px; white-space: nowrap; }
.card-body { padding: 20px 23px 0; }
.status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #87939f; min-height: 17px; margin-bottom: 17px; }
.status .icon { width: 15px; height: 15px; }
.status.success { color: #548b73; }
.status.thinking::before { content: ""; width: 12px; height: 12px; border: 1.5px solid #a3cec0; border-right-color: var(--accent); border-radius: 100%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.result-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; }
.result-title .icon { width: 16px; height: 16px; color: #82918b; }
.count-badge { padding: 2px 6px; border: 1px solid #e9eef1; border-radius: 4px; font-weight: 400; color: #95a0a9; font-size: 11px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: white; border: 1px solid #e2e7eb; color: #73818c; border-radius: 6px; padding: 6px 9px; font-size: 12px; min-height: 29px; }
.secondary-button .icon { width: 13px; height: 13px; }
.secondary-button:hover { border-color: #a8cdbb; color: var(--accent); background: #fafdfb; }
.secondary-button:disabled { opacity: .4; }
.result-table-wrapper { overflow: auto; max-height: 430px; border: 1px solid #e8edf0; border-radius: 8px; scrollbar-width: thin; }
.result-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; text-align: left; }
.result-table th { position: sticky; top: 0; padding: 11px 15px; font-weight: 500; color: #74828c; background: #f6f8f9; border-bottom: 1px solid #e6ebee; white-space: nowrap; }
.result-table td { padding: 12px 15px; color: #495764; border-bottom: 1px solid #edf0f3; white-space: nowrap; font-variant-numeric: tabular-nums; max-width: 400px; overflow: hidden; text-overflow: ellipsis; }
.result-table tr:last-child td { border-bottom: 0; }
.result-table tbody tr:hover td { background: #f8fbf9; }
.result-table .numeric { text-align: right; }
.result-meta { display: flex; align-items: center; gap: 8px; color: #a0a9b2; font-size: 12px; margin: 12px 0 19px; }
.sql-details { margin: 0 -23px; border-top: 1px solid #eef1f3; background: #fcfdfd; }
.sql-details summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 13px 23px; color: #8b98a1; font-size: 12px; }
.sql-details summary::-webkit-details-marker { display: none; }
.sql-details summary .icon { width: 14px; height: 14px; }
.sql-details summary::after { content: ""; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 5px; }
.sql-details[open] summary::after { transform: rotate(225deg); margin-top: 3px; }
.sql-duration { margin-left: auto; font-size: 11px; color: #a5afb7; }
.sql-content { padding: 0 20px 16px; }
.sql-box { margin: 0; padding: 16px; background: #1e2b32; color: #c4d8d2; font: 12px/1.9 Consolas,"SFMono-Regular",monospace; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 7px; min-height: 48px; }
.sql-toolbar { display: flex; justify-content: flex-end; margin-top: 9px; }
.skeleton { padding: 3px 0 25px; }
.skeleton-line { height: 10px; border-radius: 5px; background: linear-gradient(90deg,#f2f5f4 20%,#eaf0ed 50%,#f2f5f4 80%); background-size: 200% 100%; animation: shimmer 1.8s ease infinite; margin: 13px 0; }
.skeleton-line:nth-child(2) { width: 78%; }
.skeleton-line:nth-child(3) { width: 48%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-result { text-align: center; padding: 25px 10px 34px; }
.empty-result > .icon { width: 29px; height: 29px; color: #a8b6b0; margin-bottom: 12px; }
.empty-result h3 { margin: 0 0 9px; font-size: 14px; font-weight: 500; color: #677781; }
.empty-result p { margin: 0; font-size: 12px; color: #a0a9b2; line-height: 1.8; }
.error-card { margin: 0 0 20px; background: #fff9f7; border: 1px solid #f3e2db; border-radius: 8px; padding: 15px 16px; }
.error-header { display: flex; align-items: center; gap: 8px; color: #ae715c; font-size: 13px; margin-bottom: 8px; }
.error-header .icon { width: 16px; height: 16px; }
.error-card p { margin: 0 0 12px; font-size: 12px; color: #ae8a7d; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.error-card .secondary-button { border-color: #e8d4ca; background: transparent; color: #a77763; }
.status.failed { color: #a77763; }
.workspace-footer { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 11px; color: #a6aeb6; margin-top: 28px; text-align: center; line-height: 1.7; }
.workspace-footer .icon { width: 13px; height: 13px; }
.toast { position: fixed; bottom: 28px; left: calc(50% + 116px); transform: translateX(-50%); z-index: 50; color: #fff; background: #253b32; box-shadow: 0 6px 20px #223c3320; font-size: 13px; padding: 11px 18px; border-radius: 8px; max-width: calc(100vw - 32px); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 1500px) { .workspace { padding-top: 43px; } .welcome { padding-top: 48px; padding-bottom: 42px; } }
@media (max-width: 1180px) { .workspace { padding-right: 30px; padding-left: 30px; } .keyboard-hint { display: none; } .suggestion-card { padding: 15px; } }
@media (max-width: 900px) { .sidebar { width: 195px; padding-right: 12px; padding-left: 12px; } .app-shell { margin-left: 195px; } .workspace { padding: 28px 24px; } .topbar { padding: 0 24px; } .input-hint { font-size: 11px; } .suggestion-grid { gap: 9px; } .suggestion-question { font-size: 12px; } .toast { left: calc(50% + 97.5px); } }
@media (max-width: 720px) { .sidebar { display: none; } .app-shell { margin-left: 0; } .topbar { height: 54px; padding: 0 20px; } .workspace { padding: 25px 20px; } .welcome { padding: 24px 0 29px; } .welcome h2 { font-size: 26px; } .toast { left: 50%; } }
@media (max-width: 480px) {
    .workspace { padding: 23px 16px; } .topbar { padding: 0 17px; } .workspace-badge { font-size: 11px; }
    .page-heading h1 { font-size: 21px; } .page-tag { font-size: 11px; padding: 5px 7px; } .page-heading p { font-size: 12px; }
    .welcome h2 { font-size: 23px; } .welcome p { font-size: 12px; } .mobile-break { display: initial; }
    .query-composer { padding: 17px 16px 14px; } textarea { font-size: 14px; min-height: 100px; } textarea::placeholder { font-size: 13px; }
    .composer-footer { gap: 8px; } .input-hint { max-width: 145px; font-size: 11px; line-height: 1.6; } .input-hint .icon { display: none; }
    .primary-button { font-size: 12px; gap: 8px; padding: 8px 10px; }
    .suggestions-heading { font-size: 11px; } .suggestion-grid { grid-template-columns: 1fr; gap: 9px; }
    .suggestion-card { display: grid; grid-template-columns: 29px 1fr; grid-template-rows: auto auto; align-items: center; gap: 3px 12px; min-height: 77px; padding: 14px; }
    .suggestion-icon { grid-row: 1 / 3; margin: 0; } .suggestion-category { margin: 0; font-size: 12px; } .suggestion-question { font-size: 12px; padding-right: 13px; }
    .suggestion-arrow { top: 31px; } .question-row { padding: 16px; gap: 9px; } .q-text { font-size: 13px; } .q-time { font-size: 11px; }
    .card-body { padding: 17px 16px 0; } .sql-details { margin-right: -16px; margin-left: -16px; } .sql-details summary { padding-right: 16px; padding-left: 16px; }
    .result-table th, .result-table td { padding: 11px 12px; } .workspace-footer { font-size: 11px; padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 每条查询的设置快照与可展开依据。 */
.composer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.composer-heading .composer-label { margin: 0; }
.feature-switches { border: 0; padding: 0; margin: 0; display: flex; gap: 20px; }
.feature-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: #475865; }
.feature-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { display: inline-block; width: 31px; height: 18px; background: #c9d2d4; border-radius: 20px; padding: 3px; transition: background .15s; }
.switch-track::after { content: ""; display: block; width: 12px; height: 12px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px #0002; }
.feature-switch input:checked + .switch-track { background: var(--accent); }
.feature-switch input:checked + .switch-track::after { transform: translateX(13px); }
.feature-switch input:focus-visible + .switch-track { outline: 3px solid #8fcebc; outline-offset: 3px; }
.feature-switches:disabled { opacity: .55; }
.advanced-options { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; font-size: 12px; color: #657782; }
.advanced-options summary { cursor: pointer; width: fit-content; }
.advanced-options fieldset { border: 0; margin: 14px 0 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.advanced-options label { display: flex; align-items: center; gap: 4px; }
.advanced-options input { accent-color: var(--accent); }
.advanced-options p, .config-status { color: #8b969e; font-size: 11px; line-height: 1.7; margin: 12px 0 0; }
.query-options-snapshot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11px; color: #8c989f; margin-bottom: 17px; }
.query-options-snapshot > span:not(:first-child), .trace-badge { border: 1px solid #e0e8e5; border-radius: 6px; padding: 4px 9px; }
.snapshot-on { color: #187d68; background: #f0f8f4; }.snapshot-off { background: #f7f8f8; }
.snapshot-more { margin-left: auto; max-width: 100%; }.snapshot-more summary { cursor: pointer; }.snapshot-more[open] { flex-basis: 100%; }
.trace-container { margin: 20px 0; }.trace-container:empty { display: none; }
.query-trace { border: 1px solid #dfe9e5; border-radius: 10px; background: #fff; overflow: hidden; }
.query-trace > summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; padding: 18px; background: #fbfdfc; list-style: none; }
.query-trace > summary::-webkit-details-marker { display: none; }
.query-trace > summary::after { content: "+"; font-size: 20px; color: #83988d; }
.query-trace[open] > summary::after { content: "−"; }
.trace-title { font-weight: 600; font-size: 14px; margin-right: auto; }.trace-title small { display: block; font-size: 11px; color: #8b9b94; margin-top: 6px; font-weight: 400; }
.trace-badges { display: flex; gap: 7px; flex-wrap: wrap; }.trace-badge { font-size: 10px; white-space: nowrap; color: #81908b; }
.trace-badge.used { color: #147860; background: #edf7f2; border-color: #d5e9df; }
.trace-badge.fallback, .trace-badge.failed, .trace-badge.empty { color: #a77427; border-color: #eddfc6; background: #fffbf2; }
.trace-tabs { display: flex; gap: 22px; padding: 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trace-tab { padding: 15px 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: #8b98a1; font-size: 12px; }
.trace-tab.active { color: #167d69; border-bottom-color: #167d69; font-weight: 600; }
.trace-panel { padding: 18px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.trace-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }.trace-metrics > div { background: #f4f8f6; border: 1px solid #e5eeea; border-radius: 7px; padding: 12px 14px; }
.trace-metrics small { display: block; font-size: 11px; color: #82978d; }.trace-metrics strong { display: block; font-size: 18px; color: #2c6855; margin-top: 4px; font-weight: 600; }
.trace-muted { color: #8b979f; font-size: 11px; }.trace-notice { color: #a77837; background: #fff9ee; padding: 10px 13px; border-radius: 6px; }
.schema-steps { border-left: 2px solid #dfede6; padding-left: 14px; margin-top: 22px; }
.trace-section { border: 1px solid #e9eeec; border-radius: 8px; padding: 13px 15px; margin: 12px 0; }.trace-section h4 { margin: 0 0 10px; font-size: 12px; color: #415d50; }
.trace-section p { margin: 7px 0; }.trace-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.trace-chip { padding: 3px 8px; background: #f2f5f5; color: #637f72; border-radius: 4px; font: 11px/1.7 Consolas, "Microsoft YaHei", monospace; max-width: 100%; overflow-wrap: anywhere; }
.trace-disclosure { border-top: 1px solid #eef2ef; margin-top: 10px; padding-top: 8px; }.trace-disclosure summary { cursor: pointer; color: #7a9387; font-size: 11px; }
.trace-code { font: 11px/1.9 Consolas, "Microsoft YaHei", monospace; color: #5a7268; background: #f5f7f7; border-radius: 5px; padding: 11px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 380px; overflow: auto; margin: 8px 0; }
.trace-timing-list { margin: 10px 0; }
.trace-timing-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid #edf2ef; color: #71857a; }
.trace-timing-row dt { margin: 0; }.trace-timing-row dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trace-timing-row.failed { color: #a77427; }
.lineage-row { display: grid; grid-template-columns: minmax(80px, 1fr) 20px 3fr; gap: 8px; padding: 10px 0; border-top: 1px solid #eef2ef; }.lineage-row strong { color: #39705a; font-size: 11px; }.lineage-arrow { color: #8a9d95; }.lineage-row .trace-code { grid-column: 1 / -1; margin: 0; }
@media (max-width: 700px) {
    .composer-heading { gap: 15px; }.feature-switches { gap: 14px; }
    .query-trace > summary { flex-wrap: wrap; padding: 14px; }.trace-title { flex-basis: calc(100% - 30px); }
    .trace-badges { order: 3; width: 100%; }.trace-panel { padding: 12px; }.trace-tabs { gap: 16px; padding: 0 12px; }
    .trace-metrics > div { padding: 8px; }.trace-metrics strong { font-size: 14px; }.trace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
    .schema-steps { padding-left: 9px; }.trace-section { padding: 10px; }
}

/* Agent 与普通查询共用结果、SQL 和查询依据组件。 */
.query-mode { display: inline-flex; border: 1px solid #dfe9e4; border-radius: 9px; background: #f5f8f6; gap: 3px; padding: 4px; margin: 0; }
.query-mode label { position: relative; cursor: pointer; }
.query-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.query-mode span { display: block; padding: 8px 17px; border-radius: 6px; font-size: 12px; color: #77887e; }
.query-mode input:checked + span { background: white; color: var(--accent); box-shadow: 0 1px 5px #173e2412; font-weight: 600; }
.query-mode input:focus-visible + span { outline: 3px solid #8fcebc; outline-offset: 2px; }
.query-mode input:disabled + span { opacity: .5; cursor: not-allowed; }
.mode-description, .mode-availability { font-size: 12px; color: #7b8b83; line-height: 1.8; margin: 9px 0 19px; }
.mode-availability { color: #9c7739; }
.mode-badge { display: inline-block; background: #f1f6f3; color: #4b7d65; font-size: 11px; padding: 4px 9px; border-radius: 5px; margin-bottom: 12px; }
.agent-analysis { font-size: 13px; line-height: 1.8; min-width: 0; }
.agent-analysis h3 { font-size: 15px; margin: 0 0 9px; }.agent-analysis h4 { font-size: 13px; margin: 14px 0 8px; }
.agent-overview { background: #f5f9f7; padding: 18px; border-radius: 9px; border: 1px solid #e2ece6; }
.agent-overview p { margin: 5px 0; }.agent-goal { color: #496b59; overflow-wrap: anywhere; }
.agent-coverage { color: #7c8f84; font-size: 11px; margin: 15px 0; }
.agent-step { margin: 12px 0; border: 1px solid #e0e9e4; border-radius: 9px; min-width: 0; scroll-margin-top: 24px; }
.agent-step-heading { display: flex; align-items: center; gap: 10px; padding: 15px; cursor: pointer; list-style: none; }
.agent-step-heading::-webkit-details-marker { display: none; }.agent-step-heading::after { content: "+"; color: #8b9f93; margin-left: 3px; }.agent-step[open] > summary::after { content: "−"; }
.agent-step-number { flex-shrink: 0; color: #8ba799; font: 12px Consolas, monospace; }.agent-step-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.agent-step-state { border-radius: 4px; background: #f0f3f2; color: #839087; padding: 2px 8px; font-size: 11px; white-space: nowrap; }
.agent-step-state.running, .agent-step-state.retrying { background: #eaf4f8; color: #347892; }.agent-step-state.completed { background: #eaf6ee; color: #237754; }
.agent-step-state.failed, .agent-step-state.interrupted { background: #fdf1eb; color: #b06f48; }.agent-step-state.cancelled, .agent-step-state.skipped { background: #f6f2e9; color: #998254; }
.agent-step-duration { font-size: 11px; color: #819089; white-space: nowrap; font-variant-numeric: tabular-nums; }
.agent-step-body { padding: 0 16px 17px; border-top: 1px solid #edf2ef; min-width: 0; }
.agent-step-description { color: #75887d; overflow-wrap: anywhere; }.agent-dependencies { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.agent-step-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 14px 0; }
.agent-step-metrics > div { padding: 9px 10px; background: #f6f9f7; border-radius: 5px; }.agent-step-metrics dt { font-size: 10px; color: #8b9c91; }.agent-step-metrics dd { margin: 3px 0 0; font-size: 13px; color: #476b58; }
.agent-disclosure { border-top: 1px solid #edf2ef; padding-top: 10px; margin-top: 12px; min-width: 0; }.agent-disclosure > summary { color: #698775; font-size: 12px; cursor: pointer; }
.agent-sql-content { margin-top: 12px; }.agent-sql-content .sql-box { max-height: 400px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; margin-bottom: 9px; }
.agent-step-error { color: #b26f49; background: #fff8f3; padding: 10px 12px; border-radius: 5px; overflow-wrap: anywhere; }
.agent-step-result { margin-top: 14px; min-width: 0; }.agent-step-result:empty { display: none; }
.agent-summary, .agent-report { margin-top: 24px; padding: 18px; border: 1px solid #e0ebe4; border-radius: 9px; overflow-wrap: anywhere; }
.agent-summary:empty, .agent-report:empty { display: none; }.agent-report { background: #fbfdfb; }
.agent-report-source { padding: 3px 8px; border-radius: 4px; color: #367c5a; background: #eaf5ef; font-size: 11px; }.agent-report-source.template { color: #9f793a; background: #fbf2de; }
.agent-report-section ul { padding-left: 21px; }.agent-report-section li { margin: 7px 0; }.agent-report-section p { color: #657d6e; }
.agent-footer { margin: 20px 0; }.agent-footer .retry-button { margin-top: 13px; }
.agent-continue-button { margin-top: 14px; }
.agent-options fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.agent-options label { align-items: center; flex-wrap: wrap; gap: 8px; color: #647e6e; }
.agent-options input[type=number] { width: 76px; padding: 7px 9px; border: 1px solid #dce7e0; border-radius: 5px; font: inherit; color: #4c6e59; }
.agent-options select { min-width: 0; max-width: 100%; padding: 7px 9px; border: 1px solid #dce7e0; border-radius: 5px; background: #fff; font: inherit; color: #4c6e59; }
.agent-options textarea { grid-column: 1 / -1; width: 100%; min-height: 150px; padding: 12px; font: 12px/1.7 Consolas, monospace; border: 1px solid #dce7e0; border-radius: 6px; resize: vertical; }
.agent-storage-check { display: flex; justify-content: space-between; gap: 14px; align-items: center; color: #83988b; font-size: 11px; margin-top: 15px; }
.agent-storage-check button { font-size: 11px; white-space: nowrap; }
.agent-debug-options { border-top: 1px solid #e7efea; padding-top: 12px; margin-top: 13px; }
.agent-debug-options > summary { color: #84988b; }.agent-execution-snapshot { margin: -5px 0 16px; line-height: 1.8; }
.agent-options input:focus-visible, .agent-options select:focus-visible { outline: 3px solid #8fcebc; outline-offset: 2px; }
.agent-highlights { padding: 18px; border: 1px solid #dceae1; background: #f5faf7; border-radius: 9px; color: #426651; margin-bottom: 15px; }
.agent-highlights:empty { display: none; }.agent-key-findings { padding-left: 21px; margin-bottom: 0; }.agent-key-findings li { margin-top: 7px; }
.agent-report > summary, .agent-process > summary { cursor: pointer; font-size: 13px; color: #557e65; font-weight: 600; }
.agent-process { border: 1px solid #e0e9e4; border-radius: 9px; padding: 15px; margin: 16px 0; }
.agent-process > summary { margin: 0; }.agent-process[open] > summary { margin-bottom: 16px; }
.leave-analysis-dialog { border: 1px solid #dce7e0; border-radius: 14px; padding: 27px; width: min(470px, calc(100% - 32px)); color: var(--ink); box-shadow: 0 14px 60px #18352730; }
.leave-analysis-dialog::backdrop { background: #182f2860; }.leave-analysis-dialog h2 { margin: 0 0 15px; font-size: 19px; }
.leave-analysis-dialog p { font-size: 13px; line-height: 1.9; color: #718578; }.leave-analysis-status:empty { display: none; }.leave-analysis-dialog .leave-analysis-status { color: #a67b39; }
.leave-analysis-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 23px; flex-wrap: wrap; }
.agent-card .card-body { padding-bottom: 1px; }
@media (max-width: 720px) {
    .mobile-workspace-navigation { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 17px; background: #fdfefd; border-bottom: 1px solid #e5ece8; }
    .mobile-workspace-navigation a { flex: 1; text-align: center; padding: 9px 12px; font-size: 12px; border-radius: 7px; color: #809488; }
    .mobile-workspace-navigation a.active { color: #167d69; background: #eaf5ef; font-weight: 600; }
}
@media (max-width: 700px) {
    .agent-step-heading { flex-wrap: wrap; padding: 12px; gap: 7px; }.agent-step-name { flex-basis: calc(100% - 40px); }.agent-step-state { margin-left: 22px; }.agent-step-duration { margin-left: auto; }
    .agent-step-body { padding: 0 10px 13px; }.agent-step-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-overview, .agent-summary, .agent-report { padding: 12px; }.agent-analysis .result-table-wrapper { max-width: 100%; }
    .agent-options fieldset { grid-template-columns: 1fr; }.agent-storage-check { flex-wrap: wrap; }
    .agent-highlights, .agent-process { padding: 12px; }.leave-analysis-dialog { padding: 20px; }
}
/* 持久历史：列表与详情在宽屏并排，小屏按顺序阅读。 */
.persistent-history-search { display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:24px 0; }
.persistent-history-search label { display:grid;gap:7px;min-width:140px;color:var(--text-muted,#70818a); }
.persistent-history-search input,.persistent-history-search select { border:1px solid var(--border,#dde5e4);border-radius:9px;padding:11px;background:var(--surface,#fff);color:inherit;font:inherit; }
.persistent-history-layout { display:grid;grid-template-columns:minmax(240px,1fr) minmax(0,2fr);gap:24px;align-items:start; }
.persistent-history-item,.persistent-history-detail { background:var(--surface,#fff);border:1px solid var(--border,#dde5e4);border-radius:12px;padding:20px;margin-bottom:12px;overflow-wrap:anywhere; }
.persistent-history-item>button:first-child { display:block;width:100%;text-align:left;font-weight:600;white-space:normal; }
.persistent-history-item p { font-size:13px;line-height:1.6; }
.history-detail-actions,.history-pagination { display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:16px 0; }
.persistent-history-detail h2 { font-size:20px;line-height:1.5; }
.history-notice { padding:12px;border-radius:8px;background:#fff5dd;color:#765b20;font-size:14px;line-height:1.7; }
@media(max-width:900px) { .persistent-history-layout { grid-template-columns:1fr; } .persistent-history-search label { min-width:0;flex:1 1 140px; } }
