/* Sonora console: compact controls, native first paint, content-led hierarchy. */
@font-face{font-family:"Sonora Chinese";src:url("/assets/NotoSansSC-UI.woff2?v=a033857b543cd865") format("woff2");font-weight:400 600;font-display:swap}
.admin{--radius:6px;--border:#d4d4d4;font-family:Inter,"Sonora Chinese","Microsoft YaHei","PingFang SC",sans-serif;font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}
:root[data-theme=dark] .admin{--border:#262626}
.admin button,.admin .button{min-height:36px;padding:7px 12px;line-height:20px;font-size:13px}
.admin input,.admin textarea{padding:8px 12px;background:var(--background);line-height:20px;font-size:13px}
.admin label{gap:8px;min-width:0;font-size:12px}
.admin .icon{display:inline-flex;flex:none;width:16px;height:16px}
.admin .icon svg{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.admin .shell{grid-template-columns:195px minmax(0,1fr);height:100dvh;min-height:480px}
.admin .sidebar{height:100%;min-height:0;border-right:1px solid var(--border);padding:24px 12px 16px;gap:32px;overflow-y:auto}
.sidebar .brand{gap:12px;padding:0 12px;min-height:36px;font-size:16px;letter-spacing:0}
.sidebar .brand img{width:32px;height:32px;border-radius:6px}.sidebar .brand small{display:none}
.admin .sidebar nav{gap:4px}
.admin .nav-item{min-height:36px;gap:12px;padding:8px 12px;border-radius:6px;font-size:13px;font-weight:400}
html[data-admin-page=overview] .nav-item[data-page=overview],html[data-admin-page=users] .nav-item[data-page=users],html[data-admin-page=activation-codes] .nav-item[data-page=activation-codes],html[data-admin-page=heartbeats] .nav-item[data-page=heartbeats],html[data-admin-page=releases] .nav-item[data-page=releases]{background:var(--selected);color:var(--foreground)}
.admin .sidebar-bottom{padding:0;align-items:stretch;gap:4px}
.admin .sidebar-bottom button{gap:12px;padding:8px 12px;justify-content:flex-start;font-size:13px;color:var(--muted)}
.admin .workspace{padding:0;min-width:0;min-height:0;display:flex;flex-direction:column;container-type:inline-size}
.workspace-bar{height:56px;flex:none;padding:0 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border);font-size:12px;color:var(--muted)}
.workspace-bar>span{display:flex;align-items:center;gap:12px}#breadcrumb{color:var(--foreground)}.workspace-bar button{font-size:12px}
.admin .workspace-inner{width:100%;max-width:none;margin:0;padding:24px;flex:1;min-height:0;display:flex;flex-direction:column}
.admin .workspace-inner>header,.admin .workspace-inner>form,.admin #page-message,.admin .pagination{flex:none}
.admin #table-container{flex:1;min-height:0;display:flex;flex-direction:column}
.admin h1{font-size:24px;line-height:32px;font-weight:600;letter-spacing:0}
.admin h2{font-size:16px;line-height:24px;font-weight:600;letter-spacing:0}
.admin .page-title{align-items:center;gap:16px;margin-bottom:24px;min-height:36px}.admin .page-title .row{gap:8px}
.admin .toolbar{display:flex;gap:8px;margin-bottom:16px;align-items:center}
.search-box{position:relative;width:320px;max-width:100%;min-width:0}
.search-box>.icon{position:absolute;left:12px;top:10px;color:var(--muted);pointer-events:none}
.admin .search-box input{height:36px;min-height:36px;padding:7px 12px 7px 36px;max-width:none}
.admin .toolbar select{height:36px;min-height:36px;max-width:152px;font-size:13px}.admin .toolbar button{height:36px}
.admin #result-count{min-height:18px;font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}
.admin .table-wrap{flex:1;min-height:0;border:1px solid var(--border);border-radius:8px;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:contain;background:var(--background)}
.admin table{width:100%;table-layout:fixed;white-space:normal}
.users-table th:nth-child(1){width:9%}.users-table th:nth-child(2){width:18%}.users-table th:nth-child(3){width:22%}.users-table th:nth-child(4){width:9%}.users-table th:nth-child(5){width:13%}.users-table th:nth-child(6){width:13%}.users-table th:nth-child(7){width:16%}
.activation-codes-table th:nth-child(1){width:22%}.activation-codes-table th:nth-child(2){width:10%}.activation-codes-table th:nth-child(3){width:10%}.activation-codes-table th:nth-child(4){width:22%}.activation-codes-table th:nth-child(5){width:18%}.activation-codes-table th:nth-child(6){width:18%}
.releases-table th:nth-child(1){width:12%}.releases-table th:nth-child(2){width:13%}.releases-table th:nth-child(3){width:16%}.releases-table th:nth-child(4){width:10%}.releases-table th:nth-child(5){width:14%}.releases-table th:nth-child(6){width:17%}.releases-table th:nth-child(7){width:18%}
.admin thead th{position:sticky;top:0;z-index:1;background:var(--secondary);box-shadow:0 1px var(--border)}
.admin th{height:40px;font-size:12px;font-weight:400;white-space:nowrap}
.admin td{height:64px;font-size:12px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.admin td,.admin th{padding:12px 16px;vertical-align:middle}.admin tbody tr:last-child td{border-bottom:0}
.admin td small{font-size:11px;margin-top:4px}.admin td .row{gap:4px;flex-wrap:wrap;justify-content:flex-end}
.admin td:last-child:not(.empty-cell),.admin th:last-child{text-align:right}
.admin td button{min-height:28px;padding:4px 8px;border-color:transparent;font-size:12px;line-height:18px}.admin td button:hover{border-color:var(--border)}
.code-identity{display:flex;align-items:center;gap:4px}.code-value{font-family:ui-monospace,"Cascadia Mono",monospace;white-space:nowrap;user-select:text}
.admin td .copy-code{width:24px;height:24px;min-height:24px;flex:none;padding:4px;color:var(--muted)}
.copy-code svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.admin .badge{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;border:0;background:var(--secondary);padding:4px 8px;font-size:11px;line-height:16px;border-radius:4px}
.badge.active:before{content:"";width:4px;height:4px;background:#42816b;border-radius:50%}
.admin .table-wrap.is-empty table{height:100%}
.admin .table-wrap.is-empty tbody tr:hover{background:transparent}
.admin td.empty-cell{padding:32px 16px;text-align:center;color:var(--muted);font-weight:400}.admin .empty-cell strong{font-weight:400;font-size:13px}
#page-message:not(:empty){margin-bottom:16px}
.admin .pagination{justify-content:flex-end;font-size:12px;gap:8px;margin-top:16px}.pagination>span{margin-right:auto;font-variant-numeric:tabular-nums}
#page-info{min-height:18px}
.admin .pagination button{min-height:32px;padding:5px 12px;font-size:12px}
.overview-content{flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto}
.overview-metrics{flex:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);border-radius:8px;margin-bottom:24px}
.overview-metric{min-width:0;padding:24px;border-right:1px solid var(--border)}.overview-metric:last-child{border-right:0}
.overview-metric>span{font-size:12px;color:var(--muted)}
.overview-metric strong{display:block;font-size:32px;line-height:40px;font-weight:600;font-variant-numeric:tabular-nums;margin:12px 0 4px}
.overview-metric small{display:block;min-height:20px;font-size:11px;line-height:20px}
.overview-grid{flex:1;display:grid;grid-template-columns:minmax(0,2fr) minmax(240px,1fr);gap:24px}
.overview-section{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;padding:24px;min-width:0}.overview-section h2{font-size:14px}
.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:24px}.section-heading small{font-size:11px;white-space:nowrap}
.trend-plot{position:relative;flex:1;min-height:220px}
.trend-chart{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:visible}.trend-grid{stroke:var(--border);stroke-width:1}.trend-label{fill:var(--muted);font-size:10px;font-family:inherit}
.trend-login{fill:none;stroke:var(--foreground);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.trend-registration{fill:none;stroke:#809b91;stroke-width:2;stroke-dasharray:5 5}
.chart-legend{display:flex;gap:24px;font-size:11px;color:var(--muted);margin-top:16px}.chart-legend span:before{content:"";display:inline-block;width:16px;height:2px;vertical-align:middle;background:var(--foreground);margin-right:8px}.chart-legend span:last-child:before{background:#809b91}
.stat-list{margin:0}.stat-list>div{display:flex;justify-content:space-between;padding:16px 0;border-bottom:1px solid var(--border);font-size:12px;line-height:20px}.stat-list>div:last-child{border-bottom:0}.stat-list dt{color:var(--muted)}.stat-list dd{margin:0;font-variant-numeric:tabular-nums}
.overview-footnote{flex:none;font-size:11px;line-height:20px;min-height:20px;color:var(--muted);margin-top:16px;text-align:right}
#loading-status{font-size:11px}#table-container[aria-busy=true]{cursor:progress}
.session-error{min-height:100dvh;display:flex;flex-direction:column;gap:16px;align-items:center;justify-content:center;color:var(--muted);font-size:13px}
.admin dialog{width:480px;padding:24px;border-radius:10px;max-width:calc(100% - 32px);max-height:calc(100dvh - 48px);scrollbar-gutter:stable}
.admin dialog header{gap:16px;margin-bottom:24px}.admin dialog header button{width:32px;min-height:32px;padding:0;flex:none}
.admin dialog p{font-size:12px;overflow-wrap:anywhere}.admin dialog .form-grid{gap:16px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.admin dialog input,.admin dialog select,.admin dialog textarea{width:100%;max-width:100%;min-width:0}
.admin dialog .dialog-actions{gap:8px;padding-top:8px;flex-wrap:wrap}.admin dialog::backdrop{background:#0006;backdrop-filter:none}
#release-dialog{width:520px}#code-output{font-family:ui-monospace,"Cascadia Mono",monospace;font-size:12px;resize:vertical}
#copy-status{min-height:20px;font-size:12px;color:var(--muted)}
.upload-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:var(--muted)}.upload-status progress{width:100%;height:4px;accent-color:var(--foreground)}
.admin input[type=file]{font-size:12px;padding:6px;min-width:0}.admin input[type=file]::file-selector-button{font:inherit;padding:4px 8px;margin-right:8px;border:0;border-radius:4px;background:var(--selected);color:var(--foreground)}
.admin .auth-card{background:var(--background);box-shadow:none;backdrop-filter:none;gap:24px}.admin .auth-heading img{width:48px;margin-bottom:16px}.admin .auth-heading p{display:none}.admin .lattice{display:none}
/* Static route variants keep the correct shell visible while modules load. */
html:not([data-admin-page=overview]) [data-route=overview],html:not([data-admin-page=users]) [data-route=users],html:not([data-admin-page=activation-codes]) [data-route=activation-codes],html:not([data-admin-page=heartbeats]) [data-route=heartbeats],html:not([data-admin-page=releases]) [data-route=releases]{display:none}
html[data-admin-page=overview] #search-form,html[data-admin-page=overview] #pagination,html[data-admin-page=releases] #search-form,html:not([data-admin-page=activation-codes]) #new-code,html:not([data-admin-page=releases]) #new-release{display:none}
@media(max-width:1100px){
 .admin .workspace-inner{padding:24px}.workspace-bar{padding:0 24px}
 .overview-grid{grid-template-columns:1fr}.overview-metric{padding:20px 16px}.overview-metric strong{font-size:28px}
 .admin .toolbar{flex-wrap:wrap}.search-box{flex:1;min-width:160px}.admin #result-count{margin-left:auto}
}
@media(max-width:960px){
 .admin .sidebar .brand span,.admin .sidebar .nav-label{display:none}
 .admin .shell{grid-template-columns:52px minmax(0,1fr)}.admin .sidebar{padding:20px 8px 12px;gap:24px}.admin .sidebar>.brand{padding:0 2px}
 .admin .nav-item{justify-content:center;padding:8px}.admin .sidebar-bottom{padding:0;align-items:center}
 .admin .sidebar-bottom button{padding:8px;justify-content:center;width:36px}
 .workspace-bar{padding:0 16px;height:48px}.workspace-bar>span{gap:8px}.workspace-bar button>span:last-child{display:none}
 .admin .workspace-inner{padding:24px 16px}.admin h1{font-size:22px;line-height:28px}.admin .page-title{align-items:center;gap:12px;margin-bottom:20px}
 .admin .page-title .row{width:100%}.admin .page-title .row:empty{display:none}
 .admin .toolbar{flex-wrap:wrap}.search-box{flex:auto;width:100%}.admin .toolbar select{flex:1;max-width:none;width:112px}
 .admin .toolbar .spacer{display:none}.admin #result-count{width:100%;margin-top:4px}
 .overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:16px}.overview-metric{padding:16px 12px;border-bottom:1px solid var(--border)}
 .overview-metric:nth-child(2){border-right:0}.overview-metric:nth-child(n+3){border-bottom:0}.overview-metric strong{font-size:28px;line-height:36px}
 .overview-grid{gap:16px}.overview-section{padding:16px}.section-heading{flex-wrap:wrap;margin-bottom:16px}
 .admin .pagination{flex-wrap:wrap;gap:8px}.pagination>span{width:100%}
 .admin dialog{padding:20px;max-height:calc(100dvh - 32px)}.admin dialog .form-grid{grid-template-columns:minmax(0,1fr)}
 #loading-status{max-width:72px;white-space:nowrap}
}

@container (max-width:960px){
 .admin table,.admin tbody{display:block}.admin thead{display:none}
 .admin tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:16px;border-bottom:1px solid var(--border)}.admin tbody tr:last-child{border-bottom:0}
 .admin td{display:block;min-width:0;height:auto;padding:0;border:0}.admin td::before{content:attr(data-label);display:block;font-size:11px;color:var(--muted);margin-bottom:4px}
 .admin td[data-label="邮箱"],.admin td[data-label="注册邮箱"],.admin td[data-label="关联激活码"],.admin td[data-label="操作"],.admin td[data-label="关联账号"],.admin td[data-label="激活码 / 备注"]{grid-column:1/-1}
 .admin td:last-child:not(.empty-cell){text-align:left}.admin td .row{justify-content:flex-start}
 .admin .table-wrap.is-empty table,.admin .table-wrap.is-empty tbody{height:100%;display:flex;flex-direction:column}
 .admin .table-wrap.is-empty tr{flex:1;display:flex;align-items:center;justify-content:center}
 .admin td.empty-cell{height:auto;display:block;padding:16px}.admin td.empty-cell::before{display:none}
}

.heartbeat-content{flex:1;min-height:0;display:flex;flex-direction:column}
.heartbeats-table th:nth-child(1){width:14%}.heartbeats-table th:nth-child(2){width:20%}.heartbeats-table th:nth-child(3){width:7%}.heartbeats-table th:nth-child(4){width:12%}.heartbeats-table th:nth-child(5){width:12%}.heartbeats-table th:nth-child(6){width:12%}.heartbeats-table th:nth-child(7){width:7%}.heartbeats-table th:nth-child(8){width:9%}.heartbeats-table th:nth-child(9){width:7%}
.admin .heartbeat-auto{display:flex;flex-direction:row;align-items:center;gap:8px;color:var(--muted);white-space:nowrap}
.admin .heartbeat-auto input{width:16px;height:16px;padding:0;accent-color:var(--foreground)}
html:not([data-admin-page=heartbeats]) #heartbeat-controls{display:none}
.session-duration{font-variant-numeric:tabular-nums;white-space:nowrap}
@media(min-width:961px){.admin .heartbeats-table{min-width:1100px}.admin .heartbeats-table td,.admin .heartbeats-table th{padding-inline:12px}.heartbeats-table .code-value{font-size:11px}}
@media(max-width:960px){.admin td[data-label="用户"],.admin td[data-label="客户端 / IP"]{grid-column:1/-1}}

.admin .users-table td .row button{padding-inline:6px}
