:root{font-family:system-ui,"Microsoft Yahei",sans-serif;color:#192d42;background:#f3f6fa}*{box-sizing:border-box}body{margin:0}header{background:#102b43;color:#fff;padding:22px 5%;display:flex;justify-content:space-between;align-items:center}header strong{font-size:23px}header span{font-size:15px;font-weight:400;margin-left:14px;color:#bdd1df}main{max-width:1250px;margin:36px auto;padding:0 22px}h1{font-size:30px;letter-spacing:-1px;margin:0 0 10px}p{color:#697d90;line-height:1.7}button,input,select,textarea{font:inherit;border-radius:7px;border:1px solid #ccd7e1;padding:10px 13px}button{cursor:pointer;background:#087f86;color:white;border-color:transparent}button:hover{filter:brightness(.92)}button:disabled{opacity:.5;cursor:default}input,select,textarea{background:white;min-width:0}label{display:block}label input{margin:8px 0}input[type=checkbox]{accent-color:#087f86}#login{max-width:470px;background:#fff;border:1px solid #e1e8ee;border-radius:14px;padding:36px;margin:80px auto}#login input{width:100%}#login button{width:100%;margin-top:15px}.heading,.batch,.pager{display:flex;align-items:center;gap:12px;justify-content:space-between}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin:24px 0}.stat{background:white;border:1px solid #e1e8ee;border-radius:10px;padding:20px}.stat strong{display:block;font-size:30px;margin-top:8px}nav{display:flex;gap:8px;margin-bottom:22px}nav button{background:#e0eaee;color:#26455d}.filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.filters input{width:180px}.batch{justify-content:flex-start;background:#e7eff4;padding:12px;border-radius:8px;margin-bottom:14px}.batch button{font-size:13px}.devices{display:grid;gap:10px}.device{display:grid;grid-template-columns:24px 2fr 1fr 1fr 1fr auto;gap:14px;align-items:center;background:white;padding:18px;border:1px solid #dfe7ed;border-radius:9px}.device small{display:block;color:#7c8c9b;margin-top:5px;word-break:break-all}.badge{font-size:12px;padding:5px 9px;border-radius:20px;display:inline-block;background:#edf2f5}.badge.online{background:#d9f1e8;color:#12644b}.badge.disabled{background:#fce3df;color:#9b392c}.device button{font-size:13px}.pager{justify-content:center;margin:24px}.release,.audit{background:white;border:1px solid #dfe7ed;border-radius:8px;padding:18px;margin:12px 0;overflow-wrap:anywhere}textarea{display:block;width:100%;margin:12px 0;min-height:85px}dialog{border:1px solid #d3dfe8;border-radius:12px;width:min(650px,95vw);max-height:90vh}dialog::backdrop{background:#102b4380}.close{float:right;background:#e4ebf0;color:#284455}#detailContent{padding:30px 12px 12px;overflow-wrap:anywhere}#detailContent input{width:100%}pre{white-space:pre-wrap;font:13px/1.6 monospace}#status{position:sticky;bottom:10px;background:#fff4d9;color:#775816;padding:12px;border-radius:8px;min-height:0}#status:empty{display:none}[hidden]{display:none!important}@media(max-width:700px){main{margin:22px auto;padding:0 14px}.heading{align-items:flex-start;flex-direction:column}.stats{grid-template-columns:repeat(2,1fr);gap:10px}.stat{padding:14px}.device{grid-template-columns:24px 1fr 1fr;gap:12px}.device>div:nth-child(2){grid-column:span 2}.batch{flex-wrap:wrap}.filters input{width:100%}h1{font-size:26px}#login{margin:40px auto;padding:26px}}

/* Device editor: keep access controls separate from profile saving. */
#detailContent>h2{margin:0 0 22px}
.detail-permissions{padding:18px;background:#f3f7f9;border:1px solid #dfe7ed;border-radius:10px;margin-bottom:26px}
.detail-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.detail-section-heading h3,.detail-editor h3{margin:0;font-size:16px}
.detail-hint{font-size:13px;margin:8px 0 16px}
.detail-permission-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.permission-button{min-height:44px;font-weight:600;border:1px solid}
.permission-allowed{color:#087f68;background:#fff;border-color:#9acfc2}
.permission-disabled{color:#ae493b;background:#fff;border-color:#e4b4ac}
.permission-allowed[aria-pressed=true]{background:#d9f1e8;border-color:#087f68}
.permission-disabled[aria-pressed=true]{background:#fce3df;border-color:#ae493b}
.detail-editor{margin-bottom:28px}
.detail-editor h3{margin-bottom:18px}
.detail-field{font-size:14px;font-weight:500;margin-bottom:16px}
.detail-field input,.detail-field textarea{display:block;margin:8px 0 0;width:100%;font-weight:400}
.detail-save-actions{display:flex;justify-content:flex-end;border-top:1px solid #e1e8ee;margin-top:22px;padding-top:18px}
.detail-save-button{min-height:44px;min-width:160px;font-weight:600}
.detail-danger-actions{margin-top:24px;padding-top:18px;border-top:1px solid #e1e8ee}
.detail-revoke-button{background:transparent;color:#9b392c;border:1px solid #e4b4ac}
#detail button:focus-visible{outline:3px solid #60a5fa;outline-offset:3px}
@media(max-width:700px){.detail-permissions{padding:16px}.detail-save-button{width:100%}.detail-save-actions{padding-top:16px}.detail-revoke-button{width:100%}}

.answer-history-card{background:#fff;border:1px solid #dfe7ed;border-radius:10px;padding:22px;margin:14px 0}
.answer-history-heading{display:flex;justify-content:space-between;gap:14px;align-items:center}
.answer-history-heading h3{margin:0;font-size:18px}
.answer-history-card small{color:#697d90;overflow-wrap:anywhere}
.history-identity{font-size:14px;color:#697d90}
.history-stem{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}
.history-answer{display:block;color:#087f68;margin:18px 0;font-size:17px}
.detail-history-button{background:#e4edf3;color:#284455;margin-bottom:18px;width:100%}
nav{flex-wrap:wrap}
@media(max-width:700px){.answer-history-card{padding:16px}.answer-history-heading{align-items:flex-start;flex-direction:column}}

/* Dense history list; full text stays in the authenticated detail dialog. */
.history-table-wrap{overflow-x:auto;border:1px solid #dfe7ed;border-radius:9px;background:#fff}
.history-table{width:100%;min-width:960px;border-collapse:collapse;table-layout:fixed;font-size:13px}
.history-table th{background:#eaf0f5;color:#536b80;text-align:left;font-size:12px;font-weight:600;white-space:nowrap}
.history-table th,.history-table td{padding:10px 9px;border-bottom:1px solid #e7edf2;vertical-align:middle}
.history-table tr:last-child td{border-bottom:0}
.history-table tbody tr:hover{background:#f7fafc}
.history-table th:nth-child(1){width:120px}.history-table th:nth-child(2){width:155px}.history-table th:nth-child(3){width:140px}.history-table th:nth-child(4){width:110px}.history-table th:nth-child(6){width:76px}.history-table th:nth-child(7){width:82px}.history-table th:nth-child(8){width:64px}
.history-table small{display:block;color:#7b8b99;font-size:11px;margin-top:4px}
.history-clamp{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;line-height:1.5}
.history-time{font-size:12px;color:#697d90;line-height:1.6}
.history-answer-cell strong{color:#087f68;overflow-wrap:anywhere}
.history-table .badge{font-size:11px;padding:4px 7px;white-space:nowrap}
.history-actions button{font-size:12px;padding:7px 10px;min-height:32px}
.collection-card{display:flex;justify-content:space-between;align-items:center;gap:20px;background:white;border:1px solid #dfe7ed;border-radius:9px;padding:16px 20px;margin:10px 0}
.collection-summary{min-width:0}.collection-summary h3{font-size:16px;margin:0;overflow-wrap:anywhere}.collection-summary p{font-size:13px;margin:6px 0 0}
.collection-download{display:inline-block;text-decoration:none;white-space:nowrap;color:#087f86;background:#e3f1f0;border:1px solid #b7dbd6;border-radius:7px;padding:9px 14px;font-size:13px;font-weight:600}
.secondary-button{background:#e5edf2;color:#36546a}.collection-filter-hint{font-size:13px;margin-top:0}
@media(max-width:700px){
 .history-table-wrap{border:0;background:transparent;overflow:visible}.history-table{min-width:0;display:block}.history-table thead{display:none}.history-table tbody{display:block}.history-table tr{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;background:white;border:1px solid #dfe7ed;border-radius:8px;margin:10px 0;padding:12px}.history-table th,.history-table td{display:block;border:0;padding:0;min-width:0}.history-table td::before{content:attr(data-label);display:block;color:#8392a0;font-size:11px;margin-bottom:3px}.history-table .history-question{grid-column:1/-1}.history-table .history-time{grid-column:1/-1}.history-time::before{display:none!important}.history-table .history-actions{display:flex;align-items:center;justify-content:flex-end}.history-actions::before{display:none!important}.history-table small{margin-top:3px}.collection-card{align-items:flex-start;padding:14px;gap:12px}.collection-download{padding:8px 10px;font-size:12px}
}

nav{flex-wrap:wrap}#whitelistForm{background:#fff;border:1px solid #dfe7ed;border-radius:10px;padding:20px;margin-bottom:18px}#whitelistForm input{display:block;width:100%;max-width:550px}#whitelistRecords button{margin:4px 8px 0 0}
