:root{--bg:#f5f6f8;--surface:#fff;--border:#e6e8eb;--text:#1f2329;--muted:#6b7280;--primary:#2563eb;--danger:#dc2626;--radius:10px}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.65 -apple-system,"Segoe UI","Microsoft YaHei",sans-serif}a{color:var(--primary);text-decoration:none}a:hover{text-decoration:underline}button,input,select,textarea{font:inherit}button,.button{border:1px solid var(--border);border-radius:7px;padding:8px 15px;background:#fff;color:var(--text);cursor:pointer;display:inline-block;white-space:nowrap}button:hover,.button:hover{background:#f0f4ff;text-decoration:none}button:disabled{opacity:.5;cursor:not-allowed}.primary{background:var(--primary);border-color:var(--primary);color:#fff}.primary:hover{background:#1d4ed8;color:#fff}.ghost{background:transparent}.link{padding:0;border:0;background:none;color:var(--primary)}.link:hover{background:none;text-decoration:underline}
header{display:flex;gap:28px;align-items:center;padding:0 30px;min-height:62px;background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:10;flex-wrap:wrap}.brand{font-size:17px;font-weight:650;color:var(--text);white-space:nowrap}nav{display:flex;gap:4px;flex:1}nav a{padding:8px 12px;border-radius:7px;color:var(--muted);white-space:nowrap}nav a.active,nav a:hover{background:#eff4ff;color:var(--primary);text-decoration:none}.user{display:flex;gap:15px;align-items:center;white-space:nowrap}.user form{margin:0}main{max-width:1440px;margin:28px auto;padding:0 28px 35px}.page-head,.panel-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.page-head{margin-bottom:22px}.page-head p{margin:4px 0 0}h1{font-size:23px;margin:0;font-weight:650}h2{font-size:16px;margin:0 0 16px;font-weight:600}.panel-head h2{margin:0}.panel-head{margin-bottom:16px}.panel{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:24px;margin-bottom:20px;box-shadow:0 1px 3px #00000005}.muted,small{color:var(--muted)}small{display:block;font-size:12px}.subhead{margin-top:30px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}.stats>div{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:20px}.stats b{font-size:30px;display:block;line-height:1.4;margin-top:4px}.stats small{font-size:13px}.danger{color:var(--danger)}.warning{color:#b77909}.success{color:#16803b}.danger-text{color:var(--danger)!important}.danger-button{color:var(--danger);background:#fff5f5;border-color:#fecaca}.badge{display:inline-block;border-radius:5px;padding:2px 8px;background:#f2f4f7;color:var(--muted);font-size:12px;white-space:nowrap}.badge.danger{background:#fef2f2;color:var(--danger)}.badge.warning{background:#fff8e6;color:#a16207}.badge.success{background:#edf9ef;color:#16803b}
table{width:100%;border-collapse:collapse;text-align:left}th,td{padding:12px 10px;border-bottom:1px solid var(--border);vertical-align:top;word-break:break-word}th{font-size:12px;font-weight:500;color:var(--muted);background:#fafbfc;white-space:nowrap}tr:last-child td{border-bottom:0}.table-scroll{overflow:auto}.actions{display:flex;align-items:center;gap:12px;white-space:nowrap}.actions form{margin:0}.empty{text-align:center;color:var(--muted);padding:28px!important}.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:20px}.filters input{min-width:240px;flex:1}.filters select{width:auto;min-width:130px}.filters label{margin:0}.bars{display:grid;gap:17px}.bars a{display:flex;align-items:center;gap:10px;color:var(--text)}.bars a span{min-width:85px}.bars i{display:block;flex:1;height:9px;border-radius:10px;background:#edf0f5;overflow:hidden}.bars em{display:block;height:100%;border-radius:10px;background:#5688ee}.chips{display:flex;gap:9px;flex-wrap:wrap}.chips>a,.chips>span{background:#f5f7fa;border:1px solid var(--border);padding:7px 12px;border-radius:6px;color:var(--text)}.chips b{color:var(--primary);margin-left:6px}.chips small{display:inline;color:var(--muted);margin-left:5px}
input,select,textarea{width:100%;padding:8px 10px;border:1px solid #d9dde5;border-radius:6px;background:#fff;color:var(--text);min-height:39px}input:focus,select:focus,textarea:focus{outline:2px solid #dbeafe;border-color:#93b4f8}input[type=checkbox]{width:16px;min-height:auto;vertical-align:middle}textarea{resize:vertical;line-height:1.6}label{display:block;margin-bottom:15px;font-size:13px}label>input,label>select,label>textarea{display:block;margin-top:6px}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 20px}.form-grid .full{grid-column:1/-1}.form-grid.compact{padding:0}.form-grid button{align-self:end;justify-self:start;margin-bottom:15px}.form-actions,.toolbar{display:flex;align-items:center;gap:12px}.toolbar form{margin:0}.inline-form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.inline-form>input{max-width:300px}.inline-form label{margin:0}.inline-form>button{height:39px}.check{display:flex;align-items:center;gap:6px;margin-top:6px}.check>input{margin:0}.narrow{max-width:520px}.auth{width:420px;max-width:calc(100vw - 32px);margin:12vh auto 0;background:#fff;padding:34px;border:1px solid var(--border);border-radius:12px;box-shadow:0 6px 32px #00000006}.auth h1{font-size:22px}.auth .primary{width:100%;margin-top:8px}.flash,.alert{padding:12px 16px;background:#edf9ef;border:1px solid #c9e7d0;border-radius:8px;margin-bottom:20px;color:#166534}.error{background:#fff4f4;border-color:#fecaca;color:#991b1b}.detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}.detail-grid strong{display:block;white-space:pre-wrap;word-break:break-word;font-weight:500;margin-top:4px}.detail-grid .wide{grid-column:1/-1}.detail-grid .link{margin-right:12px}.detail-grid p{margin:5px 0 0;white-space:normal;word-break:break-word}.renew-form{display:flex;align-items:end;gap:15px;flex-wrap:wrap}.renew-form label{margin:0;min-width:180px}.renew-form button{height:39px}.field-edit summary{cursor:pointer}.field-edit form{margin-top:18px}.field-edit summary .badge{margin-left:8px}.secret{white-space:pre-wrap;overflow-wrap:anywhere}.detail .secret{min-height:24px}
dialog{border:1px solid var(--border);border-radius:12px;padding:25px;width:390px;max-width:calc(100vw - 32px);box-shadow:0 10px 40px #0002}dialog::backdrop{background:#0006}dialog p{margin:0 0 22px;white-space:pre-wrap}dialog .buttons{display:flex;justify-content:flex-end;gap:10px}.pagination{display:flex;gap:10px;align-items:center;margin-top:16px}.pagination span{color:var(--muted)}.field-password textarea{font-family:inherit}
@media(max-width:1100px){header{gap:12px;padding:10px 18px}nav{order:3;width:100%;overflow:auto}.user{margin-left:auto}nav a{padding:7px 10px}.form-grid,.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stats{gap:10px}}
@media(max-width:600px){main{padding:0 14px;margin-top:18px}.panel{padding:16px}.stats{grid-template-columns:repeat(2,1fr)}.stats>div{padding:14px}.page-head{align-items:flex-start}h1{font-size:20px}.form-grid,.detail-grid{grid-template-columns:1fr}.filters>*{flex:1!important;width:100%!important}.toolbar{flex-wrap:wrap}.auth{padding:25px}.actions{gap:9px}.renew-form label{width:100%}}
.category-tree{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:20px;margin-top:18px}.category-tree>div{display:grid;align-content:start;gap:8px}.category-tree a:not(.tree-category){padding-left:12px;font-size:13px}.tree-category{font-weight:600}
@media(max-width:1100px){header nav{flex-basis:100%;min-width:0}.grid.two table,.table-scroll table{min-width:600px}td:nth-child(4){white-space:nowrap}}
.stats{grid-template-columns:repeat(6,1fr)}
@media(max-width:1100px){.stats{grid-template-columns:repeat(3,1fr)}}
@media(max-width:600px){.stats{grid-template-columns:repeat(2,1fr)}}
.renew-options{display:flex;flex-wrap:wrap;gap:10px}.renew-options button{height:auto!important;text-align:left}.renew-options small{color:inherit;opacity:.8;font-size:11px}
.expiry-time{white-space:nowrap}.expiry-group .empty{margin:0}.expiry-group table{min-width:620px}.expiry-groups{min-width:0}
.filters{align-items:flex-end}.filters input,.filters select,.filters>button,.filters>.button{height:40px;font-size:14px}.filters>button,.filters>.button{display:inline-flex;align-items:center;justify-content:center}
.form-actions>button,.form-actions>.button{height:40px;margin-bottom:0;display:inline-flex;align-items:center;justify-content:center;font-size:14px}
.filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px 12px;align-items:end}.filters>label{min-width:0;margin:0;display:flex;flex-direction:column;gap:6px}.filters>label>input,.filters>label>select{margin:0}.filters input,.filters select{min-width:0;width:100%}.filter-actions{display:flex;gap:10px;align-items:center;height:40px}.filter-actions>button,.filter-actions>.button{height:40px;display:inline-flex;align-items:center;justify-content:center;margin:0;font-size:14px}
.datetime-control{position:relative;display:flex;width:100%;min-width:0;margin-top:6px}.datetime-control .datetime-text{width:100%;min-width:0;height:40px;padding-right:40px;margin:0;font-size:14px}.datetime-control .datetime-icon{position:absolute;right:0;top:0;width:38px;height:40px;display:flex;align-items:center;justify-content:center;border-left:1px solid var(--border);color:var(--muted);pointer-events:none}.datetime-control .datetime-picker{position:absolute;right:0;top:0;width:38px;min-width:0;height:40px;min-height:0;opacity:0;padding:0;margin:0;cursor:pointer}.datetime-picker::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:100%;height:100%;margin:0;cursor:pointer}.datetime-control:focus-within{outline:2px solid #dbeafe;border-radius:6px}.filters>label>.datetime-control{margin:0}
.provider-row{display:grid;grid-template-columns:minmax(0,300px) max-content max-content;justify-content:start;gap:12px;align-items:center;margin:12px 0}.provider-row button{height:40px;margin:0;padding:0 15px;display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:1}.provider-row input{height:40px;min-width:0;margin:0}
.confirm-dialog{font:inherit;color:var(--text);background:#fff;border:0;border-radius:14px;width:360px;max-width:calc(100vw - 40px);padding:28px 24px 20px;box-shadow:0 8px 32px rgba(0,0,0,.18)}.confirm-dialog::backdrop{background:rgba(0,0,0,.4)}.confirm-dialog .confirm-message{font-size:15px;line-height:1.8;font-weight:400;text-align:center;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 22px}.confirm-dialog .buttons{display:flex;gap:12px}.confirm-dialog .buttons button{flex:1;min-width:0;height:40px;margin:0;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;font:inherit;font-size:14px}
@media(max-width:600px){.provider-row{grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}.provider-row>input:not([type=hidden]){grid-column:1/-1}.provider-row button{width:100%}}
.provider-row{grid-template-columns:minmax(120px,220px) minmax(180px,1fr) max-content max-content}.provider-row input[type=url]{width:100%}input[readonly]{background:#f7f8fa;color:var(--muted)}
.table-scroll td>.secret+.reveal{margin-left:12px}.table-scroll td>.reveal+.copy-secret{margin-left:12px}
.provider-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}.provider-tabs a{display:inline-flex;align-items:center;gap:8px;padding:7px 13px;border:1px solid var(--border);border-radius:7px;color:var(--muted);white-space:nowrap}.provider-tabs a.active,.provider-tabs a:hover{background:#eff4ff;color:var(--primary);border-color:#c7d8fc;text-decoration:none}.provider-tabs span{font-size:12px;opacity:.8}#account-list{scroll-margin-top:140px}
.secret-editor{display:block;margin-top:6px}.secret-editor>input{height:40px;margin:0}.secret-editor>textarea{display:block;width:100%;-webkit-text-security:disc}.secret-editor>textarea.revealed{-webkit-text-security:none}.secret-editor-actions{display:flex;gap:14px;align-items:center;min-height:28px;margin-top:5px}.form-grid .secret-editor-actions>button{margin:0;padding:0;height:auto;align-self:center;font-size:12px}.secret-editor-actions .check{margin:0;font-size:12px}.ip-cell{min-width:140px;white-space:pre-line}.note-cell{min-width:160px;max-width:300px;overflow-wrap:anywhere}.expiry-group table{min-width:980px}.badge.muted{background:#f0f1f3;color:#6b7280}
.form-grid input:not([type=hidden]):not([type=checkbox]){height:40px}
.identity-cell{min-width:180px;overflow-wrap:anywhere}.filters .legacy-query{grid-column:1/-1;color:var(--muted)}
.ip-cell{white-space:normal;line-height:1.4}
.bulk-selection{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.bulk-selection .check{margin:0}.bulk-selection>span{color:var(--muted)}.bulk-controls{display:flex;gap:12px;align-items:flex-end;margin-top:14px;flex-wrap:wrap}.bulk-controls label{margin:0;min-width:240px;max-width:100%;flex:1}.bulk-controls button{height:40px;display:inline-flex;align-items:center}.select-cell{width:40px;text-align:center}.bulk-clear-bar{padding:18px 24px}
.filter-actions>.button{background:#fff;color:var(--text)}.filter-actions>.button:hover{background:#f0f4ff}
.provider-create{align-items:center}.provider-create>input,.provider-create>button{height:40px;margin:0;font-size:14px}.provider-create>button{display:inline-flex;align-items:center;justify-content:center;padding-top:0;padding-bottom:0}
.dashboard-sections{display:block;min-width:0}.dashboard-sections>.panel,.dashboard-sections .expiry-group{width:100%}
.history-selection{align-items:center}.history-selection>.check,.history-selection>[data-history-selected-count],.history-selection>button{height:40px;margin:0;display:inline-flex;align-items:center;font-size:14px;line-height:1.4}.history-selection>.check>input{margin:0;flex-shrink:0}.history-selection>button{justify-content:center;padding-top:0;padding-bottom:0}
@media(max-width:700px){.provider-row{grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}.provider-row>input:not([type=hidden]){grid-column:1/-1}}
