/* AI 配置继承经营光谱：配置、试用、已验证状态分明。 */
.ai-workspace{display:grid;gap:18px}
.ai-workspace>.page-head{margin-bottom:0}
.ai-setup-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;padding:0;margin:0;list-style:none;border-bottom:1px solid var(--line-strong)}
.ai-setup-steps li{min-width:0;padding:0 0 12px}.ai-setup-steps li>button{display:flex;gap:11px;align-items:center;width:100%;padding:4px 0;border:0;border-radius:6px;text-align:left}.ai-setup-steps li>button:hover{background:var(--surface-soft)}
.ai-setup-steps li>button>span{display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:6px;background:var(--surface-soft);font-size:13px;font-weight:600}.ai-setup-steps li>button[aria-current]>span{background:var(--yellow)}
.ai-setup-steps b{display:block;font-size:13px;font-weight:600}.ai-setup-steps small{display:block;color:var(--muted);font-size:12px}
.ai-provider-section,.ai-scenes-section,.ai-test-section{min-width:0;background:var(--surface);border-radius:var(--radius);padding:17px 19px}
.ai-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:14px}
.ai-section-head .row-actions{flex:none;align-self:center}.ai-section-head .row-actions>.field{flex-direction:row;align-items:center;white-space:nowrap}.ai-section-head .row-actions select{width:104px;min-height:34px;height:34px;padding:5px 7px}
.ai-provider-split{display:grid;grid-template-columns:210px minmax(0,1fr);gap:24px}.ai-provider-directory{display:flex;flex-direction:column;gap:6px;border-right:1px solid var(--line);padding-right:17px}
.ai-provider-row{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:70px;padding:10px 11px;border:1px solid transparent;border-radius:7px;text-align:left;font-size:13px;transition:background var(--motion)}
.ai-provider-row:hover{background:var(--surface-soft)}.ai-provider-row.is-selected{background:var(--accent-soft);border-color:var(--line-strong)}.ai-provider-row span,.ai-provider-row small{color:var(--muted);font-size:12px}
.ai-provider-empty{padding:9px 0;font-size:13px}.ai-provider-empty p{margin-top:6px;color:var(--muted);font-size:12px;line-height:1.8}
.ai-provider-form{min-width:0;display:grid;gap:11px}.ai-provider-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px}
.ai-provider-form textarea{min-height:78px;max-height:150px;line-height:1.5;padding:8px 10px}.ai-provider-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:3px}.ai-checkbox{display:inline-flex;gap:7px;align-items:center;font-size:12px;color:var(--muted)}
.ai-provider-options{display:flex;align-items:center;gap:18px;flex-wrap:wrap}.ai-provider-foot>.hint{max-width:36ch}.ai-synthetic-test-choice{display:grid;grid-template-columns:220px minmax(0,1fr);gap:18px;align-items:center}.ai-synthetic-test-choice b{font-size:13px;font-weight:500}.ai-synthetic-test-choice p{margin-top:4px}.ai-connection-check>.row-actions>.field{max-width:230px}.ai-connection-check>.row-actions select{min-height:34px;height:34px;font-size:12px}
.ai-inline-status{font-size:12px;color:var(--muted);line-height:1.6}.ai-inline-status.is-good{color:var(--good)}
.ai-scenes-table-wrap{overflow:auto;max-height:calc(100dvh - 345px);min-height:280px;overscroll-behavior:contain}.ai-scenes-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:12px}.ai-scenes-table th{position:sticky;top:0;z-index:1;padding:8px 9px;text-align:left;font-size:12px;font-weight:500;color:var(--muted);border-bottom:1px solid var(--line-strong);background:var(--surface-soft)}
.ai-scenes-table td{padding:10px 9px;border-bottom:1px solid var(--line);vertical-align:middle}.ai-scenes-table tr:last-child td{border-bottom:0}.ai-scenes-table th:first-child{width:38%}.ai-scenes-table th:nth-child(2){width:18%}.ai-scenes-table th:nth-child(3){width:20%}.ai-scenes-table th:nth-child(4){width:12%}.ai-scenes-table th:last-child{width:12%}
.ai-scene-name{display:flex;gap:8px;align-items:flex-start;color:var(--text)}.ai-scene-name input{margin-top:3px}.ai-scene-name b{font-size:13px;line-height:1.5}.ai-scene-name small{display:block;color:var(--muted);font-size:12px;line-height:1.5;margin-top:2px}.ai-scene-purpose{font-size:12px;color:var(--muted);line-height:1.6;margin:3px 0 0 25px;max-width:50ch}
.ai-scenes-table select{height:34px;min-height:34px;padding:5px 6px;font-size:12px}.ai-scene-actions{display:flex;gap:1px;flex-wrap:wrap}.ai-scene-actions>.btn{padding:4px 5px;min-height:30px;font-size:12px}.ai-scenes-table .is-disabled .ai-scene-name{color:var(--muted)}
.ai-scenes-foot{display:flex;justify-content:space-between;gap:15px;font-size:12px;color:var(--muted);padding-top:9px}
.ai-connection-check{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:0 0 15px;margin-bottom:15px}.ai-connection-check>div:first-child{flex:1;min-width:220px}.ai-connection-check b{font-size:13px}.ai-test-receipt{flex:1 0 100%;display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--surface-soft);border-radius:7px;padding:9px 11px;font-size:12px}.ai-test-receipt p{flex:1}.ai-test-receipt small{font-size:12px;color:var(--muted)}.ai-test-receipt.is-good{background:var(--good-soft);color:var(--good)}.ai-test-receipt.is-error{background:var(--bad-soft);color:var(--bad)}
.ai-scene-test-form{display:grid;gap:12px}.ai-test-fields{display:grid;grid-template-columns:1.5fr 1.2fr 1.2fr 1fr 1fr;gap:12px}.ai-test-fields input,.ai-test-fields select{height:35px;min-height:35px;font-size:12px;padding:6px 8px}.ai-scene-test-form textarea{min-height:86px;max-height:210px;font-size:13px}.ai-test-run{display:flex;justify-content:space-between;align-items:center;gap:14px}
.ai-test-output{min-width:0;overflow:hidden;background:#FFF;border-radius:9px;padding:13px 14px}.ai-test-output>header{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px;font-size:13px}.ai-test-output>header span{font-size:12px;color:var(--muted)}.ai-test-output pre{margin:0 0 10px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7;max-height:400px;overflow:auto}.ai-output-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.9;max-height:400px;overflow:auto;margin-bottom:10px}
.ai-company-rules{padding:0 2px}.ai-company-rules>p{font-size:12px;line-height:1.8;max-width:85ch;margin-bottom:10px}.ai-company-rules summary{font-size:13px}
.ai-error{padding:12px 14px;border-radius:8px;background:var(--bad-soft);color:var(--bad);font-size:13px}.ai-error p{margin-top:4px;font-size:12px;line-height:1.7}.ai-read-state{padding:30px 20px;background:var(--surface);border-radius:var(--radius);margin-top:18px}.ai-read-state p{color:var(--muted);font-size:13px;margin:8px 0 14px}.ai-loading-lines{display:grid;gap:9px;max-width:400px}.ai-loading-lines i{height:13px;background:var(--surface-soft);border-radius:4px}.ai-loading-lines i:nth-child(2){width:83%}.ai-loading-lines i:last-child{width:65%}.ai-status-line{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px}.ai-status-line>span{flex:1;color:var(--muted)}.ai-prompt-intro{margin-bottom:14px}.ai-prompt-intro>p{font-size:13px;margin-bottom:8px}.ai-prompt-intro+p{margin-top:10px}
@media(min-width:1500px){.ai-provider-split{grid-template-columns:240px minmax(0,1fr)}.ai-provider-fields{grid-template-columns:1fr 1fr 1.8fr 1.5fr}}
@media(max-width:1080px){.ai-provider-split{grid-template-columns:170px minmax(0,1fr);gap:17px}.ai-scenes-table th:first-child{width:33%}.ai-scenes-table th:nth-child(3){width:23%}.ai-scenes-table th:last-child{width:14%}.ai-test-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.ai-scenes-foot{flex-direction:column;gap:3px}}
@media(max-width:720px){.ai-synthetic-test-choice{grid-template-columns:minmax(0,1fr);gap:10px}.ai-provider-options{align-items:flex-start;gap:9px;flex-direction:column}.ai-provider-foot>.hint{max-width:none}}
@media(max-width:720px){.ai-setup-steps li>button{align-items:flex-start;gap:7px}.ai-setup-steps li>button>span{width:22px;height:22px;font-size:12px}.ai-scenes-table-wrap{max-height:none;min-height:0}}
@media(max-width:720px){.ai-workspace{gap:14px}.ai-setup-steps{gap:10px}.ai-setup-steps li{gap:7px;align-items:flex-start;padding-bottom:12px}.ai-setup-steps b{font-size:12px}.ai-setup-steps small{display:none}.ai-setup-steps li>span{width:22px;height:22px;font-size:12px}.ai-provider-section,.ai-scenes-section,.ai-test-section{padding:15px}.ai-section-head{gap:10px;flex-wrap:wrap}.ai-section-head .row-actions{width:100%;justify-content:space-between}.ai-provider-split{grid-template-columns:minmax(0,1fr);gap:13px}.ai-provider-directory{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid var(--line);padding:0 0 11px}.ai-provider-row{flex:none;min-width:180px;min-height:65px}.ai-provider-empty{padding:0}.ai-provider-fields{grid-template-columns:minmax(0,1fr);gap:10px}.ai-provider-foot{align-items:flex-start;flex-direction:column}.ai-provider-foot>.row-actions{width:100%;justify-content:space-between}.ai-scenes-table-wrap{overflow:visible}.ai-scenes-table,.ai-scenes-table tbody{display:block}.ai-scenes-table thead{display:none}.ai-scenes-table tr{display:grid;grid-template-columns:1fr 1fr;gap:9px 12px;border-bottom:1px solid var(--line);padding:12px 0}.ai-scenes-table td{display:flex;flex-direction:column;gap:4px;border:0;padding:0;min-width:0}.ai-scenes-table td::before{content:attr(data-label);font-size:12px;color:var(--muted)}.ai-scenes-table td:first-child{grid-column:1 / -1}.ai-scenes-table td:first-child::before{display:none}.ai-scenes-table td:last-child{flex-direction:row;align-items:center;justify-content:flex-end}.ai-scenes-table td:last-child::before{display:none}.ai-scenes-table select{min-height:40px}.ai-scene-actions>.btn{min-height:40px;padding:6px 10px;font-size:12px}.ai-scene-purpose{max-width:none}.ai-test-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ai-test-fields>.field:first-child{grid-column:1 / -1}.ai-test-fields input,.ai-test-fields select{min-height:40px;height:40px}.ai-connection-check>.row-actions{width:100%;justify-content:space-between}.ai-test-run{align-items:flex-end}.ai-test-output>header{flex-direction:column;gap:3px}.ai-scenes-foot{font-size:12px}.ai-key-field small{font-size:12px}}

/* The single order-understanding scene uses content height, not an empty multi-scene canvas. */
.admin-mode .ai-workspace{gap:14px;min-width:0;max-width:1540px;margin:0 auto}
.admin-mode .ai-setup-steps{gap:14px}
.admin-mode .ai-provider-section,.admin-mode .ai-scenes-section,.admin-mode .ai-test-section{padding:14px 18px}
.admin-mode .ai-section-head{margin-bottom:12px}
.admin-mode .ai-section-head h2{font-size:17px;font-weight:500}
.admin-mode .ai-scenes-table-wrap{min-height:0;max-height:360px;scrollbar-gutter:stable}
.admin-mode .ai-scenes-table{font-size:13px}
.admin-mode .ai-scenes-table td{padding:12px 9px}
.admin-mode .ai-scene-purpose{white-space:normal;overflow-wrap:anywhere}
.admin-mode .ai-scenes-foot{padding-top:12px;line-height:1.65}
.admin-mode .ai-provider-split{grid-template-columns:180px minmax(0,1fr);gap:18px}
.admin-mode .ai-provider-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
.admin-mode .ai-provider-row{min-height:60px;padding:8px 10px}
.admin-mode .ai-provider-form textarea{min-height:78px}
.admin-mode .ai-call-history,.admin-mode .ai-company-rules{font-size:13px;padding:10px 2px;border-top:1px solid var(--line)}
.admin-mode .ai-call-history>summary,.admin-mode .ai-company-rules>summary{cursor:pointer;min-height:32px;font-size:13px;font-weight:500}
.admin-mode .ai-call-history[open]>.hint{margin:8px 0}
.admin-mode .ai-call-history .table-wrap{max-height:320px;overflow:auto}
.admin-mode .ai-company-rules>p{margin:8px 0 0;line-height:1.7}
@media(max-width:720px){
 .admin-mode .ai-setup-steps li>button{min-height:44px}
 .admin-mode .ai-provider-section,.admin-mode .ai-scenes-section,.admin-mode .ai-test-section{padding:14px 15px}
 .admin-mode .ai-provider-split{grid-template-columns:minmax(0,1fr);gap:12px}
 .admin-mode .ai-provider-fields{grid-template-columns:minmax(0,1fr)}
 .admin-mode .ai-workspace input:not([type=checkbox]),.admin-mode .ai-workspace select,.admin-mode .ai-workspace textarea{font-size:16px;min-height:44px}
 .admin-mode .ai-workspace select,.admin-mode .ai-test-fields input,.admin-mode .ai-test-fields select{height:44px}
 .admin-mode .ai-workspace .btn,.admin-mode .ai-scene-actions>.btn{min-height:44px;font-size:13px}
 .admin-mode .ai-scenes-table-wrap{max-height:none;min-height:0}
 .admin-mode .ai-scenes-table select{min-height:44px;height:44px;font-size:16px}
 .admin-mode .ai-scenes-table select{width:100%;min-width:0}
 .admin-mode .ai-checkbox,.admin-mode .ai-scene-name{min-height:44px}
 .admin-mode .ai-scene-actions>.btn{min-height:44px;padding:7px 10px}
 .admin-mode .ai-connection-check>.row-actions>.field{max-width:none;flex:1 1 180px}
 .admin-mode .ai-connection-check>.row-actions select{min-height:44px;height:44px;font-size:16px}
 .admin-mode .ai-synthetic-test-choice select{font-size:16px;min-height:44px}
 .admin-mode .ai-test-run{align-items:stretch;gap:10px;flex-wrap:wrap}
 .admin-mode .ai-test-run>.hint{flex:1 1 100%}
 .admin-mode .ai-call-history>summary,.admin-mode .ai-company-rules>summary{min-height:44px}
}

.ai-routing-summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;margin:0 0 16px;padding:14px 16px;border:1px solid var(--line,#e5e7e3);border-radius:10px;background:#f7f8f6}.ai-routing-summary>.hint,.ai-routing-summary p{max-width:620px;margin:5px 0 0}.ai-routing-models{display:flex;gap:28px}.ai-routing-models>div{display:grid;gap:3px;min-width:156px}.ai-routing-models small,.ai-routing-models span{font-size:12px;color:var(--muted,#727772)}.ai-routing-models b{font-size:14px}@media(max-width:1050px){.ai-routing-summary{grid-template-columns:1fr}.ai-routing-models{flex-wrap:wrap}}
