@charset "UTF-8";
:root{
  --bg:#f7f7f8;--surface:#fff;--ink:#18181b;--ink-2:#3f3f46;--muted:#71717a;--faint:#a1a1aa;
  --line:#e7e7ea;--line-2:#f1f1f3;--hover:#f6f6f7;--soft:#f4f4f5;
  --accent:#2563eb;--accent-soft:#eff4ff;--ring:#2563eb26;
  --green:#15803d;--green-soft:#ecfaf1;--amber:#b45309;--amber-soft:#fef6e7;--rose:#e11d48;--rose-soft:#fff0f2;
  --radius:14px;--radius-sm:9px;
  --shadow:0 1px 2px #18181b0a;--shadow-md:0 1px 3px #18181b0d,0 8px 24px -12px #18181b1f;--shadow-lg:0 24px 60px -12px #18181b38,0 0 0 1px #18181b0d;
  --mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
  --font:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI",Roboto,sans-serif
}
*{box-sizing:border-box}
body{margin:0;color:var(--ink);font-family:var(--font);font-size:14px;line-height:1.55;background:var(--bg);-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;border:0;user-select:none}
a{color:inherit;text-decoration:none}
button:disabled{cursor:not-allowed;opacity:.4}
[hidden]{display:none!important}
h1,h2,h3,p{margin:0}
strong{font-weight:600}
svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
input,select,textarea{width:100%;min-width:0;height:38px;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;color:var(--ink);padding:0 12px;outline:0;transition:border-color .15s,box-shadow .15s;font-size:14px;box-shadow:var(--shadow)}
textarea{height:auto;padding:10px 12px;resize:vertical}
select{appearance:none;-webkit-appearance:none;padding-right:32px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center/15px}
input::placeholder,textarea::placeholder{color:var(--faint)}
input:hover,select:hover,textarea:hover{border-color:#d4d4d8}
input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--ring)}
input:disabled,select:disabled,textarea:disabled{background:var(--soft);color:var(--muted);box-shadow:none}
label{display:block;font-size:13px;font-weight:500;color:var(--ink-2);margin:18px 0 7px}
button:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.muted{color:var(--muted)}
.mono{font-family:var(--mono)}
.eyebrow{display:block;color:var(--faint);font-size:11px;letter-spacing:.1em;font-weight:600}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Buttons */
.button{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;padding:0 15px;border-radius:var(--radius-sm);font-size:14px;font-weight:500;border:1px solid transparent;white-space:nowrap;transition:background .15s,border-color .15s,transform .1s}
.button svg{width:16px;height:16px;stroke-width:2}
.button:active:not(:disabled){transform:translateY(1px)}
.button.primary{color:#fff;background:var(--ink);box-shadow:0 1px 2px #18181b29,inset 0 1px 0 #ffffff1f}
.button.primary:hover:not(:disabled){background:#27272a}
.button.secondary{background:#fff;border-color:var(--line);color:var(--ink-2);box-shadow:var(--shadow)}
.button.secondary:hover:not(:disabled){background:var(--hover);border-color:#d4d4d8}
.button.small{height:32px;padding:0 12px;font-size:13px}
.button.full{width:100%}
.text-button{background:none;color:var(--muted);font-size:13px;font-weight:500;white-space:nowrap;padding:4px 0;transition:color .15s}
.text-button:hover{color:var(--ink)}
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:var(--radius-sm);background:transparent;color:var(--muted);font-size:22px;line-height:1;transition:background .15s,color .15s}
.icon-button:hover{background:var(--soft);color:var(--ink)}
.icon-button.bordered{border:1px solid var(--line);background:#fff;box-shadow:var(--shadow)}
.status-dot{display:inline-block;width:6px;height:6px;background:#22c55e;border-radius:50%;flex-shrink:0}

/* Brand */
.brand{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:650;line-height:1.2;color:var(--ink)}
.brand small{display:block;font-size:10px;font-weight:500;letter-spacing:.14em;margin-top:3px;color:var(--faint)}
.brand-mark{display:none;width:36px;height:36px;flex:0 0 36px}
.brand-mark svg.vsphp-monogram{width:36px;height:36px;display:block;stroke:none}
.brand-copy>svg.vsphp-wordmark{width:136px;height:47px;display:block;stroke:none}
.brand-copy>small{padding-left:3px}
.admin-shell.collapsed .brand-mark{display:grid;place-items:center}

/* Messages */
.inline-message{padding:10px 13px;border-radius:var(--radius-sm);font-size:13px;line-height:1.65;border:1px solid transparent}
.inline-message.error{color:#be123c;background:var(--rose-soft);border-color:#fdd5dc}
.inline-message.notice{color:#92400e;background:var(--amber-soft);border-color:#f9e3b8}
.field-hint{font-size:12px;color:var(--faint);margin-top:6px;line-height:1.6}
.optional{font-size:12px;font-weight:400;margin-left:4px}
.page-message{margin-bottom:20px}
.boot-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;gap:12px;color:var(--muted)}
.spinner{display:inline-block;width:18px;height:18px;border:2px solid var(--line);border-top-color:var(--ink);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.toast{position:fixed;top:50%;right:env(safe-area-inset-right,0px);bottom:auto;left:env(safe-area-inset-left,0px);margin-inline:auto;transform:translateY(-50%);z-index:1000;box-sizing:border-box;width:max-content;max-width:min(720px,calc(100vw - 32px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)));max-height:calc(100vh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable both-edges;-webkit-overflow-scrolling:touch;touch-action:pan-y;background:var(--ink);color:#fff;padding:12px 20px;border-radius:14px;box-shadow:var(--shadow-lg);font-size:13px;line-height:1.55;text-align:center;white-space:normal;overflow-wrap:anywhere;word-break:break-word;pointer-events:auto;user-select:text;animation:toast-in .2s ease-out}
.toast.error{background:#be123c}
@keyframes toast-in{from{opacity:0;transform:translateY(calc(-50% + 10px)) scale(.98)}}
@media(max-width:480px){.toast{width:calc(100vw - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));max-width:none;padding:12px 14px;border-radius:12px}}
@media(max-height:420px){.toast{max-height:calc(100dvh - 20px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));padding:9px 14px;font-size:12px;line-height:1.45}}

/* Shell */
.admin-shell{min-height:100vh}
.sidebar{width:232px;position:fixed;inset:0 auto 0 0;z-index:30;display:flex;flex-direction:column;padding:20px 12px 12px;background:#fbfbfc;border-right:1px solid var(--line)}
.sidebar>.brand{padding:2px 8px}
.nav-caption{padding:0 10px;margin:30px 0 8px;font-size:11px;letter-spacing:.08em;color:var(--faint);font-weight:600}
.side-nav{display:flex;flex-direction:column;gap:2px}
.nav-item{display:flex;align-items:center;gap:10px;height:36px;padding:0 10px;text-align:left;color:var(--muted);background:transparent;border-radius:8px;width:100%;font-size:14px;font-weight:500;transition:background .12s,color .12s}
.nav-item svg{width:18px;height:18px;color:var(--faint);transition:color .12s}
.nav-item:hover{background:var(--soft);color:var(--ink)}
.nav-item:hover svg{color:var(--ink-2)}
.nav-item.active{background:#fff;color:var(--ink);box-shadow:0 1px 2px #18181b14,0 0 0 1px var(--line)}
.nav-item.active svg{color:var(--ink)}
.sidebar-bottom{margin-top:auto}
.sidebar-user{display:flex;align-items:center;gap:10px;padding:10px;border-radius:11px;border:1px solid var(--line);background:#fff;box-shadow:var(--shadow)}
.sidebar-user strong{color:var(--ink);display:block;font-size:13px;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-user small{font-size:11px;color:var(--faint)}
.sidebar-user .icon-button{margin-left:auto;width:30px;height:30px}
.avatar{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:var(--soft);color:var(--ink-2);font-size:13px;font-weight:600;box-shadow:inset 0 0 0 1px var(--line)}
.sidebar-backdrop{position:fixed;inset:0;background:#18181b33;z-index:25;backdrop-filter:blur(2px)}
.main-column{margin-left:232px;min-width:0}
.topbar{position:sticky;top:0;z-index:20;height:56px;padding:0 32px;display:flex;align-items:center;justify-content:space-between;gap:20px;background:#f7f7f8d9;backdrop-filter:saturate(1.8) blur(12px);-webkit-backdrop-filter:saturate(1.8) blur(12px);border-bottom:1px solid var(--line)}
.topbar-left,.topbar-right{display:flex;align-items:center;gap:12px}
.breadcrumb{font-size:13px;color:var(--faint)}
.breadcrumb>span{color:#d4d4d8;margin:0 8px}
.breadcrumb strong{font-weight:500;color:var(--ink)}
.live-indicator{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);padding:4px 10px;border-radius:999px;border:1px solid var(--line);background:#fff}
.free-plan-upgrade{display:inline-flex;align-items:center;max-width:min(42vw,440px);padding:5px 11px;border:1px solid #f3d7a4;border-radius:999px;background:var(--amber-soft);color:#92400e;font-size:12px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:border-color .15s,background .15s}
.free-plan-upgrade:hover{border-color:#e7bd72;background:#fff4d9}
.today-label{color:var(--muted);font-size:13px}
.menu-toggle{display:none}
.content{max-width:1360px;margin:0 auto;padding:32px 32px 48px}

/* Page */
.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:24px}
.page-heading h1{font-size:24px;font-weight:650;letter-spacing:-.02em;line-height:1.3}
.page-heading p{font-size:14px;color:var(--muted);margin-top:3px}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}
.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px;box-shadow:var(--shadow)}
.stat-label{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:13px;font-weight:500}
.stat-label{flex-direction:row-reverse}
.stat-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:8px}
.stat-icon svg{width:16px;height:16px}
.indigo{color:var(--ink-2);background:var(--soft)}
.amber{color:var(--amber);background:var(--amber-soft)}
.green{color:var(--green);background:var(--green-soft)}
.rose{color:var(--rose);background:var(--rose-soft)}
.stat-card>strong{display:block;font-size:30px;font-weight:650;letter-spacing:-.03em;line-height:1.2;margin:12px 0 4px;font-variant-numeric:tabular-nums}
.stat-foot{font-size:12px;color:var(--faint)}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;margin-bottom:20px}
.panel-heading{padding:16px 20px;display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid var(--line-2)}
.panel-heading h2{font-size:15px;font-weight:600}
.panel-heading p{font-size:13px;color:var(--muted);margin-top:1px}
.overview-grid{display:grid;grid-template-columns:minmax(0,1fr) 296px;gap:20px}
.quick-list{padding:8px}
.quick-action{display:flex;align-items:center;gap:12px;width:100%;padding:11px 12px;background:none;text-align:left;border-radius:10px;transition:background .12s}
.quick-action:hover{background:var(--hover)}
.quick-action strong{display:block;font-size:14px;color:var(--ink);font-weight:500}
.quick-action small{display:block;font-size:12px;color:var(--muted);margin-top:1px}
.quick-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:9px;flex-shrink:0}
.quick-icon svg{width:17px;height:17px}

/* Tables */
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap}
th{font-size:12px;font-weight:500;color:var(--muted);background:#fafafb;padding:10px 20px;border-bottom:1px solid var(--line)}
td{padding:13px 20px;border-bottom:1px solid var(--line-2);color:var(--ink-2);font-size:14px;vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:#fafafb}
.empty-cell{height:160px;text-align:center;color:var(--faint)!important;font-size:14px;background:none!important}
.align-right{text-align:right}
.badge{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:500;background:var(--soft);color:var(--muted);border:1px solid transparent}
.badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.badge.active{background:var(--green-soft);color:var(--green);border-color:#d3f1df}
.badge.unused,.badge.unbound{background:var(--amber-soft);color:var(--amber);border-color:#f8e5c0}
.badge.expired{background:var(--soft);color:var(--muted);border-color:var(--line)}
.badge.disabled{background:var(--rose-soft);color:var(--rose);border-color:#fdd9df}
.cell-main{display:flex;align-items:center;gap:4px;min-width:0}
.cell-subtitle{display:block;font-size:12px;color:var(--faint);max-width:220px;overflow:hidden;text-overflow:ellipsis;margin-top:1px}
.license-code{font-family:var(--mono);font-size:13px;color:var(--ink);letter-spacing:.02em}
.device-code{display:inline-block;max-width:170px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;font-family:var(--mono);font-size:12.5px;color:var(--muted)}
.unbound-text{color:var(--faint);font-size:13px}
.copy-btn{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:7px;background:transparent;color:var(--faint);flex-shrink:0;transition:background .12s,color .12s}
.copy-btn svg{width:14px;height:14px}
.copy-btn:hover{background:var(--soft);color:var(--ink)}
.row-actions{display:flex;justify-content:flex-end;align-items:center;gap:6px}
.row-action{display:inline-flex;align-items:center;height:28px;padding:0 10px;border-radius:7px;border:1px solid var(--line);background:#fff;color:var(--ink-2);font-size:13px;font-weight:500;white-space:nowrap;box-shadow:var(--shadow);transition:background .12s,border-color .12s,color .12s}
.row-action:hover:not(:disabled){background:var(--hover);border-color:#d4d4d8;color:var(--ink)}
.row-action.danger{color:var(--rose)}
.row-action.danger:hover:not(:disabled){background:var(--rose-soft);border-color:#fdd5dc;color:#be123c}
.row-action.accent{color:var(--ink)}
.app-name-cell{display:flex;align-items:center;gap:12px}
.app-name-cell strong{color:var(--ink);font-weight:550}
.app-avatar{height:34px;width:34px;display:grid;place-items:center;border-radius:9px;font-size:14px;font-weight:600;color:var(--ink-2);background:var(--soft);box-shadow:inset 0 0 0 1px var(--line);flex-shrink:0}
.app-avatar.off{color:var(--faint)}
.log-detail{display:block;max-width:440px;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}
.log-action{font-weight:500;color:var(--ink)}
.filter-bar{display:flex;align-items:center;gap:10px;padding:14px 20px;flex-wrap:wrap;border-bottom:1px solid var(--line-2)}
.filter-bar select{width:148px}
.search-field{display:flex;align-items:center;gap:8px;height:38px;border:1px solid var(--line);border-radius:var(--radius-sm);padding-left:12px;margin:0;flex:1;min-width:200px;max-width:360px;background:#fff;box-shadow:var(--shadow);transition:border-color .15s,box-shadow .15s}
.search-field svg{width:16px;height:16px;color:var(--faint)}
.search-field input{border:0;box-shadow:none!important;background:none;height:36px;padding:0 12px 0 0}
.search-field:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--ring)}
.table-footer{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:12px 20px;border-top:1px solid var(--line-2);font-size:13px}
.pagination{display:flex;align-items:center;gap:12px;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}

/* Modals */
.modal{background:#fff;border:0;padding:24px 26px 20px;border-radius:16px;box-shadow:var(--shadow-lg);width:480px;max-width:calc(100vw - 32px);max-height:calc(100vh - 48px);color:var(--ink);overflow-y:auto}
.modal[open]{animation:modal-in .16s ease-out}
@keyframes modal-in{from{opacity:0;transform:translateY(6px) scale(.985)}}
.modal::backdrop{background:#18181b40;backdrop-filter:blur(3px)}
.modal-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
.modal-heading h2{font-size:18px;font-weight:650;letter-spacing:-.01em;margin-top:6px}
.modal-heading>.icon-button{margin:-6px -10px 0 0}
.modal-description{font-size:14px;margin-top:6px;line-height:1.7}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin:22px -26px -20px;padding:14px 26px;border-top:1px solid var(--line-2);background:#fafafb}
.modal-actions.spread{justify-content:space-between;align-items:center}
.modal-actions>div{display:flex;gap:8px}
.modal .inline-message{margin-top:16px}
.modal .quiet-note{margin-top:16px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.checkbox-label{display:flex;align-items:center;gap:9px;font-weight:500;font-size:14px;color:var(--ink-2)}
.checkbox-label input{width:16px;height:16px;accent-color:var(--ink);margin:0;box-shadow:none}
.quiet-note{display:flex;align-items:flex-start;gap:9px;border-radius:var(--radius-sm);background:var(--soft);padding:10px 12px;color:var(--muted);font-size:13px;line-height:1.6}
.quiet-note .status-dot{margin-top:7px;background:var(--faint)}
.generated-keys{font-family:var(--mono);font-size:13px;height:240px;margin-top:16px;line-height:1.9;background:#fafafb;white-space:pre}
.config-change-note{font-size:13px}
.config-loading{display:flex;align-items:center;gap:9px;padding:24px 0 4px;color:var(--muted);font-size:14px}
.config-header{height:260px;font-size:12px}
.result-modal{width:620px}
.modal:not([open]){display:none}
.modal.fallback-modal{display:block;position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);margin:0;z-index:101}
.fallback-dialog-backdrop{position:fixed;inset:0;background:#18181b40;backdrop-filter:blur(3px);z-index:100}
.modal-open{overflow:hidden}

/* Login */
.login-screen{position:relative;min-height:100vh;display:grid;place-items:center;padding:40px 20px;overflow:hidden;background:var(--bg)}
.login-glow{position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(#18181b0a 1px,transparent 1px),linear-gradient(90deg,#18181b0a 1px,transparent 1px);background-size:44px 44px;mask-image:radial-gradient(55% 55% at 50% 45%,#000,transparent);-webkit-mask-image:radial-gradient(55% 55% at 50% 45%,#000,transparent)}
.login-wrap{position:relative;width:380px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.login-brand{margin-bottom:24px}
.login-card{width:100%;background:#fff;border-radius:16px;padding:28px;box-shadow:var(--shadow-md);border:1px solid var(--line)}
.login-card h2{font-size:20px;font-weight:650;letter-spacing:-.01em}
.login-card>.muted{font-size:14px;margin-top:4px;margin-bottom:6px}
.login-card .inline-message{margin-top:16px}
.login-card .button{margin-top:22px;height:40px}
.login-foot{display:flex;align-items:center;gap:8px;margin-top:20px;font-size:12px;color:var(--faint)}

@media(max-width:1180px){
  .sidebar{width:212px}
  .main-column{margin-left:212px}
  .content{padding:26px 24px 40px}
  .topbar{padding:0 24px}
  .free-plan-upgrade{max-width:300px}
  .today-label{display:none}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .overview-grid{grid-template-columns:1fr}
  .quick-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
  .cards-table.stackable thead{display:none}
  .cards-table.stackable,.cards-table.stackable tbody{display:block}
  .cards-table.stackable tr{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--line-2)}
  .cards-table.stackable tr:last-child{border-bottom:0}
  .cards-table.stackable td{display:block;padding:0;border:0;background:none!important;min-width:0;white-space:nowrap}
  .cards-table.stackable td::before{content:attr(data-label);display:block;font-size:11px;color:var(--faint);margin-bottom:3px;font-weight:500}
  .cards-table.stackable td:first-child,.cards-table.stackable td:nth-child(4){grid-column:span 2}
  .cards-table.stackable td:last-child{grid-column:1/-1;padding-top:12px;border-top:1px dashed var(--line)}
  .cards-table.stackable td:last-child::before{display:none}
  .cards-table.stackable td:last-child .row-actions{justify-content:flex-start}
  .cards-table.stackable .empty-cell{grid-column:1/-1;display:grid;place-items:center}
  .cards-table.stackable .empty-cell::before{display:none}
  .cards-table.stackable .device-code{max-width:100%}
}
@media(max-width:760px){
  .sidebar{transform:translateX(-100%);transition:transform .22s ease;width:256px}
  .sidebar.open{transform:none;box-shadow:var(--shadow-lg)}
  .main-column{margin-left:0}
  .topbar{padding:0 16px}
  .menu-toggle{display:inline-flex;margin-left:-6px}
  .live-indicator{display:none}
  .free-plan-upgrade{max-width:calc(100vw - 145px);font-size:11px}
  .content{padding:20px 16px 32px}
  .page-heading{flex-wrap:wrap;align-items:center;margin-bottom:18px}
  .page-heading h1{font-size:21px}
  .page-heading p{font-size:13px}
  .stats-grid{gap:10px}
  .stat-card{padding:14px 16px}
  .stat-card>strong{font-size:24px;margin-top:10px}
  .quick-list{grid-template-columns:1fr}
  .panel-heading{padding:14px 16px}
  th,td{padding-left:16px;padding-right:16px}
  .filter-bar{padding:12px 16px}
  .search-field{max-width:none;flex-basis:100%}
  .filter-bar select{width:auto;flex:1;min-width:110px}
  .cards-table.stackable tr{grid-template-columns:repeat(2,minmax(0,1fr));padding:16px}
  .cards-table.stackable td:first-child,.cards-table.stackable td:nth-child(4){grid-column:1/-1}
  .row-actions{flex-wrap:wrap}
  .table-footer{padding:12px 16px}
  .modal{padding:20px 18px 18px}
  .modal-actions{margin:20px -18px -18px;padding:12px 18px}
  .form-row{grid-template-columns:1fr}
  .modal-actions.spread{flex-wrap:wrap}
  .modal-actions.spread>div{margin-left:auto}
  .login-card{padding:24px 20px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* Page forms: generate / app settings / config export */
.back-link{display:inline-flex;align-items:center;gap:2px;background:none;color:var(--muted);font-size:13px;font-weight:500;padding:0;margin:0 0 8px -4px;transition:color .12s}
.back-link svg{width:16px;height:16px}
.back-link:hover{color:var(--ink)}
.generate-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.generate-main{min-width:0}
.generate-side{position:sticky;top:76px}
.form-panel{padding:22px 24px 24px}
.form-panel>label:first-of-type{margin-top:20px}
.step{display:flex;align-items:flex-start;gap:12px}
.step h2{font-size:15px;font-weight:600}
.step p{font-size:13px;color:var(--muted);margin-top:1px}
.step-no{width:24px;height:24px;flex-shrink:0;display:grid;place-items:center;border-radius:50%;background:var(--ink);color:#fff;font-size:12px;font-weight:600;margin-top:1px}
.app-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin-top:18px}
.app-option{margin:0;cursor:pointer;position:relative}
.app-option input{position:absolute;opacity:0;pointer-events:none}
.app-option-body{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:var(--shadow);transition:border-color .12s,box-shadow .12s,background .12s}
.app-option-body>span:nth-child(2){min-width:0;flex:1}
.app-option strong{display:block;font-size:14px;color:var(--ink);font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-option small{display:block;font-size:12px;color:var(--muted);font-weight:400;margin-top:1px}
.app-option:hover .app-option-body{border-color:#d4d4d8}
.app-option-check{width:18px;height:18px;border-radius:50%;border:1.5px solid #d4d4d8;flex-shrink:0;transition:all .12s}
.app-option input:checked+.app-option-body{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink),var(--shadow-md)}
.app-option input:checked+.app-option-body .app-option-check{border:5px solid var(--ink)}
.app-option input:focus-visible+.app-option-body{box-shadow:0 0 0 3px var(--ring)}
.picker-empty{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;border:1px dashed var(--line);border-radius:12px;color:var(--muted);font-size:14px}
.segmented{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.segmented label{margin:0;cursor:pointer}
.segmented input{position:absolute;opacity:0;pointer-events:none}
.segmented span{display:inline-flex;align-items:center;height:38px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:14px;color:var(--ink-2);box-shadow:var(--shadow);transition:all .12s}
.segmented label:hover span{border-color:#d4d4d8}
.segmented input:checked+span{background:var(--ink);border-color:var(--ink);color:#fff}
.segmented input:focus-visible+span{box-shadow:0 0 0 3px var(--ring)}
.count-presets{display:flex;gap:6px;margin-top:8px}
.count-presets button{height:28px;padding:0 10px;border-radius:7px;background:var(--soft);color:var(--muted);font-size:12px;font-weight:500;font-variant-numeric:tabular-nums;transition:all .12s}
.count-presets button:hover{color:var(--ink)}
.count-presets button.active{background:var(--ink);color:#fff}
.summary-panel{padding:22px}
.summary-count{display:flex;align-items:baseline;gap:8px;margin:10px 0 16px}
.summary-count strong{font-size:40px;font-weight:650;letter-spacing:-.03em;line-height:1;font-variant-numeric:tabular-nums}
.summary-count span{font-size:14px;color:var(--muted)}
.summary-list{margin:0;border-top:1px solid var(--line-2)}
.summary-list>div{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px solid var(--line-2);font-size:14px}
.summary-list dt{color:var(--muted)}
.summary-list dd{margin:0;color:var(--ink);font-weight:500;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.summary-sample{margin-top:14px;padding:12px 14px;border-radius:10px;background:var(--soft)}
.summary-sample span{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
.summary-sample code{font-family:var(--mono);font-size:14px;color:var(--ink);letter-spacing:.06em;word-break:break-all}
.summary-panel .inline-message{margin-top:14px}
.summary-panel .button{margin-top:10px}
.summary-panel .button.large{margin-top:16px}
.summary-panel .quiet-note{margin-top:16px}
.button.large{height:46px;font-size:15px;border-radius:11px}
.summary-foot{font-size:12px;color:var(--faint);line-height:1.6;margin-top:12px;text-align:center}
.result-panel{padding:0}
.result-head{display:flex;align-items:center;gap:16px;padding:24px;border-bottom:1px solid var(--line-2)}
.result-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:var(--green-soft);color:var(--green);flex-shrink:0;box-shadow:inset 0 0 0 1px #d3f1df}
.result-icon svg{width:22px;height:22px;stroke-width:2.4}
.result-title{flex:1;min-width:0}
.result-title h2{font-size:18px;font-weight:650}
.result-title p{font-size:14px;color:var(--muted);margin-top:2px}
.result-actions{display:flex;gap:8px}
.generated-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px;padding:20px 24px;max-height:520px;overflow-y:auto}
.code-chip{display:flex;align-items:center;gap:10px;padding:8px 8px 8px 12px;border:1px solid var(--line);border-radius:10px;background:#fafafb}
.code-chip .license-code{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.code-index{font-size:11px;color:var(--faint);font-variant-numeric:tabular-nums;font-family:var(--mono)}
.result-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 24px;border-top:1px solid var(--line-2);background:#fafafb}
.switch-row{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0 0;padding:14px 16px;border:1px solid var(--line);border-radius:12px;cursor:pointer}
.switch-row strong{display:block;font-size:14px;color:var(--ink);font-weight:550}
.switch-row small{display:block;font-size:12px;color:var(--muted);font-weight:400;margin-top:2px}
.switch{position:relative;flex-shrink:0}
.switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;box-shadow:none}
.switch-track{display:block;width:40px;height:24px;border-radius:999px;background:#d4d4d8;transition:background .15s;position:relative}
.switch-track::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #18181b40;transition:transform .15s}
.switch input:checked+.switch-track{background:var(--ink)}
.switch input:checked+.switch-track::after{transform:translateX(16px)}
.switch input:focus-visible+.switch-track{box-shadow:0 0 0 3px var(--ring)}
.app-preview{display:flex;align-items:center;gap:12px;margin:14px 0 16px}
.app-preview strong{display:block;font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-preview small{display:block;font-size:13px;color:var(--muted)}
.app-preview>div{min-width:0}
.app-avatar.large{width:48px;height:48px;border-radius:12px;font-size:20px}
.code-panel{padding:0}
.code-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}
.file-name{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:13px;color:var(--ink-2)}
.file-name svg{width:16px;height:16px;color:var(--faint)}
.code-actions{display:flex;gap:8px}
.code-block{margin:0;padding:20px;font-family:var(--mono);font-size:13px;line-height:1.8;color:var(--ink-2);background:#fafafb;white-space:pre-wrap;word-break:break-all;min-height:220px}
.config-loading{padding:40px 20px;justify-content:center}
.config-error-wrap{display:flex;align-items:center;gap:12px;padding:20px}
.config-error-wrap .inline-message{flex:1}
.guide-steps{list-style:none;margin:14px 0 0;padding:0;counter-reset:step}
.guide-steps li{position:relative;padding:0 0 18px 38px;counter-increment:step}
.guide-steps li::before{content:counter(step);position:absolute;left:0;top:0;width:24px;height:24px;display:grid;place-items:center;border-radius:50%;background:var(--soft);color:var(--ink-2);font-size:12px;font-weight:600;box-shadow:inset 0 0 0 1px var(--line)}
.guide-steps li:not(:last-child)::after{content:"";position:absolute;left:11.5px;top:28px;bottom:4px;width:1px;background:var(--line)}
.guide-steps strong{display:block;font-size:14px;font-weight:550}
.guide-steps span{display:block;font-size:13px;color:var(--muted);margin-top:1px}
.row-action.armed{background:var(--rose);border-color:var(--rose);color:#fff}
.row-action.armed:hover:not(:disabled){background:#be123c;border-color:#be123c;color:#fff}
@media(max-width:1180px){
  .generate-layout{grid-template-columns:1fr}
  .generate-side{position:static}
}
@media(max-width:760px){
  .form-panel{padding:18px 16px 20px}
  .result-head{flex-wrap:wrap;padding:18px 16px}
  .result-actions{width:100%}
  .result-actions .button{flex:1}
  .generated-list{padding:16px;grid-template-columns:1fr}
  .result-foot{padding:12px 16px}
  .segmented span{padding:0 13px;height:36px}
}

/* Grouped sidebar menu */
.sidebar>.brand{margin-bottom:22px}
.side-nav{flex:1;min-height:0;overflow-y:auto;margin:0 -4px;padding:0 4px;scrollbar-width:thin}
.nav-group+.nav-group{margin-top:2px}
.nav-group-head{display:flex;align-items:center;gap:10px;width:100%;height:36px;padding:0 10px;border-radius:8px;background:none;color:var(--ink-2);font-size:14px;font-weight:550;text-align:left;transition:background .12s}
.nav-group-head:hover{background:var(--soft)}
.nav-group-head>svg:first-child{width:18px;height:18px;color:var(--muted)}
.nav-group-head span{flex:1;white-space:nowrap}
.nav-group-head .chev{width:16px;height:16px;color:var(--faint);transition:transform .15s}
.nav-group.open .chev{transform:rotate(180deg)}
.nav-sub{display:none;flex-direction:column;gap:1px;padding:2px 0 6px}
.nav-group.open .nav-sub{display:flex}
.nav-sub .nav-item{height:32px;padding:0 10px 0 38px;font-size:13.5px;justify-content:flex-start}
.nav-tag{margin-left:auto;font-size:10px;font-weight:500;line-height:1;padding:3px 6px;border-radius:5px;background:var(--soft);color:var(--faint);white-space:nowrap}
.nav-item.active .nav-tag{background:var(--soft)}
.sidebar-bottom{padding-top:12px}
.menu-toggle{display:inline-flex}
@media(min-width:761px){
.admin-shell.collapsed .sidebar{width:64px;padding-left:10px;padding-right:10px}
.admin-shell.collapsed .main-column{margin-left:64px}
.admin-shell.collapsed .brand>span:last-child,.admin-shell.collapsed .nav-group-head span,.admin-shell.collapsed .nav-group-head .chev,.admin-shell.collapsed .nav-sub,.admin-shell.collapsed .sidebar-user>div,.admin-shell.collapsed .sidebar-user .icon-button{display:none}
.admin-shell.collapsed .sidebar>.brand{padding:2px 6px}
.admin-shell.collapsed .nav-group-head{justify-content:center;padding:0}
.admin-shell.collapsed .nav-group:has(.nav-item.active) .nav-group-head{background:#fff;box-shadow:0 1px 2px #18181b14,0 0 0 1px var(--line)}
.admin-shell.collapsed .sidebar-user{justify-content:center;padding:6px}
}

/* Page tabs */
.tabbar{position:sticky;top:56px;z-index:19;display:flex;gap:6px;padding:8px 32px;overflow-x:auto;background:var(--bg);border-bottom:1px solid var(--line);scrollbar-width:none}
.tabbar::-webkit-scrollbar{display:none}
.tab{display:flex;align-items:center;flex-shrink:0;height:30px;border-radius:8px;border:1px solid transparent;color:var(--muted);transition:background .12s,color .12s}
.tab:hover{background:var(--soft);color:var(--ink)}
.tab.active{background:#fff;border-color:var(--line);color:var(--ink);box-shadow:var(--shadow)}
.tab-label{height:100%;padding:0 12px;background:none;color:inherit;font-size:13px;font-weight:500;white-space:nowrap}
.tab-close{width:20px;height:20px;margin-right:5px;margin-left:-6px;border-radius:5px;background:none;color:var(--faint);font-size:15px;line-height:1;display:grid;place-items:center}
.tab-close:hover{background:var(--line);color:var(--ink)}

/* Overview */
.shortcuts{display:flex;flex-wrap:wrap;gap:8px;padding:16px 20px 18px}
.shortcut{display:inline-flex;align-items:center;gap:9px;height:40px;padding:0 14px 0 6px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink-2);font-size:14px;font-weight:500;box-shadow:var(--shadow);transition:border-color .12s,background .12s}
.shortcut:hover{border-color:#d4d4d8;background:var(--hover);color:var(--ink)}
.shortcut .quick-icon{width:28px;height:28px;border-radius:7px}
.shortcut .quick-icon svg{width:15px;height:15px}
.shortcut.soon{color:var(--muted)}
.shortcut .nav-tag{margin-left:2px}
.stat-tiles{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;padding:16px 20px 20px}
.stat-tile{padding:14px 16px;border-radius:10px;background:#fafafb;border:1px solid var(--line-2)}
.stat-tile span{display:block;font-size:12px;color:var(--muted)}
.stat-tile strong{display:block;font-size:26px;font-weight:650;letter-spacing:-.02em;margin-top:6px;font-variant-numeric:tabular-nums;line-height:1.2}
.t-green{color:var(--green)}.t-amber{color:var(--amber)}.t-rose{color:var(--rose)}.t-muted{color:var(--muted)}
.overview-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}

/* Upcoming module template */
.title-tag{display:inline-block;vertical-align:middle;margin-left:10px;font-size:12px;font-weight:500;letter-spacing:0;padding:3px 8px;border-radius:6px;background:var(--amber-soft);color:var(--amber);border:1px solid #f8e5c0}
.soon-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start}
.plan-list{list-style:none;margin:0;padding:12px 20px 18px}
.plan-list li{position:relative;padding:8px 0 8px 26px;font-size:14px;color:var(--ink-2);line-height:1.6}
.plan-list li::before{content:"";position:absolute;left:2px;top:13px;width:14px;height:14px;border-radius:4px;border:1.5px solid #d4d4d8}

@media(max-width:1180px){
  .tabbar{padding:8px 24px}
  .stat-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}
  .overview-grid.two,.soon-layout{grid-template-columns:1fr}
}
@media(max-width:760px){
  .tabbar{top:56px;padding:8px 16px}
  .stat-tiles{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px 16px 16px}
  .shortcuts{padding:14px 16px 16px}
}

/* 授权功能升级：沿用当前后台布局，仅补充新增控件与完整字段显示。 */
.admin-page table .license-code,.admin-page table .device-code{white-space:pre-wrap;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;word-break:break-all;max-width:none;min-width:0}
.admin-page table .cell-main{align-items:flex-start}
.admin-page table .license-code{max-width:300px}
.admin-page table .device-code{max-width:310px}
.full-width{grid-column:1/-1}
.custom-duration{margin-top:18px}
.bulk-search{padding:14px 20px;border-bottom:1px solid var(--line-2)}
.bulk-search summary{cursor:pointer;color:var(--ink-2);font-size:14px;font-weight:550}
.bulk-search form{margin-top:12px}
.bulk-search textarea{font-family:var(--mono);font-size:13px}
.bulk-search-actions{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;padding-bottom:1px}
.bulk-search-state{margin:0;padding:0 20px;font-size:13px;line-height:1.7}
.bulk-search-state:not(:empty){padding-top:12px;padding-bottom:12px;border-bottom:1px solid var(--line-2)}
.selection-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 20px;border-bottom:1px solid var(--line-2);font-size:12px}
.selection-bar .checkbox-label{margin:0;white-space:nowrap}
.selection-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}
.selection-cell{width:44px;min-width:44px}
.selection-cell input,.selection-bar input{width:16px;height:16px;min-height:0;margin:0;accent-color:var(--ink);cursor:pointer}
.badge.deleted{background:var(--soft);color:var(--faint);border-color:var(--line)}
.danger-button{background:var(--rose)!important;border-color:var(--rose)!important;color:white!important}
.button.danger{color:var(--rose)}
.announcement-excerpt{display:block;white-space:pre-wrap;overflow-wrap:anywhere;max-width:620px;margin-top:4px;color:var(--muted);font-size:13px}
.wrap-text{white-space:pre-wrap;overflow-wrap:anywhere;max-width:380px}
.device-table{min-width:780px}
#app-free-settings{margin-top:12px;padding:0 16px 14px;border:1px solid var(--line);border-radius:12px}
#app-announcement-fields{margin-top:14px}
@media(max-width:1180px){
  .cards-table.stackable td:first-child{grid-column:1/-1}
  .cards-table.stackable td:nth-child(2),.cards-table.stackable td:nth-child(5){grid-column:span 2;white-space:normal}
  .cards-table.stackable td:nth-child(4){grid-column:span 1}
  .cards-table.stackable .selection-cell::before{display:none}
  .admin-page .cards-table.stackable .license-code,.admin-page .cards-table.stackable .device-code{max-width:none}
}
@media(max-width:760px){
  .bulk-search,.selection-bar{padding:12px 16px}
  .bulk-search-state{padding-left:16px;padding-right:16px}
  .selection-actions{width:100%;margin-left:0}
  .selection-bar>span{width:100%}
  .cards-table.stackable td:nth-child(2),.cards-table.stackable td:nth-child(5){grid-column:1/-1}
  .cards-table.stackable td:nth-child(4){grid-column:auto}
  .device-table{min-width:720px}
}
.badge.frozen{background:var(--amber-soft);color:var(--amber);border-color:#f8e5c0}
.frozen-remaining{max-width:none;white-space:normal;overflow:visible;color:var(--amber)}
.maintenance-label{color:var(--amber)}
.maintenance-control{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:18px}
.remote-values-note{margin-bottom:16px}
.remote-values-table{min-width:1050px}
.variable-key{display:block;max-width:220px;overflow-wrap:anywhere;white-space:normal;font-family:var(--mono);font-size:13px}
.variable-meta{display:block;margin-top:5px;color:var(--muted);font-size:12px;line-height:1.6;white-space:normal}
.variable-preview{max-width:300px;max-height:84px;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--mono);font-size:12px;line-height:1.65;margin:0}
.remote-value-modal{width:760px}
.remote-value-modal .form-row{margin-top:14px}
.remote-value-options{align-items:center;margin-bottom:14px}
.remote-value-options .checkbox-label{margin-top:24px}
.remote-value-editor{font-family:var(--mono);font-size:13px;line-height:1.7;min-height:240px;tab-size:2}
.value-too-large{color:var(--rose)!important}
@media(max-width:760px){.remote-value-options .checkbox-label{margin-top:0}.remote-value-editor{min-height:200px}.remote-values-table{min-width:980px}}

/* Cloud functions */
#view-functions>.quiet-note{margin-bottom:16px}
.quiet-note code,.guide-steps code{font-family:var(--mono);font-size:12px;padding:1px 5px;border-radius:5px;background:#fff;border:1px solid var(--line)}
.test-actions{display:flex;align-items:center;gap:12px;margin-top:14px}
.test-result{margin-top:14px;border-radius:10px;border:1px solid var(--line);max-height:360px;overflow:auto;min-height:0}
.snippet{margin:12px 0 16px;padding:14px;border-radius:10px;border:1px solid var(--line);font-size:12px;min-height:0;white-space:pre;overflow-x:auto;word-break:normal}
#function-bindings .switch{display:inline-block}

/* By-version parameter editor */
.version-rows{display:flex;flex-direction:column;gap:8px}
.version-row{display:grid;grid-template-columns:150px minmax(0,1fr) auto;gap:8px;align-items:center}
.version-row input{font-family:var(--mono);font-size:13px}
.version-editor>.button{margin-top:10px}
@media(max-width:760px){.version-row{grid-template-columns:1fr 1fr}.version-row .row-action{grid-column:1/-1;justify-self:start}}

/* One-click integration */
.integrate-input{margin-top:16px;font-size:12.5px;line-height:1.6;min-height:280px}
.integrate-run{margin-top:16px}
.integrate-changes{padding:14px 20px;border-bottom:1px solid var(--line-2);font-size:13px}
.integrate-changes ul{margin:6px 0 0;padding-left:18px;color:var(--ink-2);line-height:1.8}
.integrate-output{max-height:560px;overflow:auto;white-space:pre;word-break:normal}

.function-picker{margin-top:16px;border:1px solid var(--line);border-radius:12px;max-height:420px;overflow-y:auto}
.function-picker .picker-empty{margin:0;padding:16px;color:var(--muted);font-size:14px;border:0}
.function-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid var(--line-2)}
.function-row:last-child{border-bottom:0}
.function-name{min-width:0;display:flex;align-items:baseline;gap:8px}
.function-name code{font-family:var(--mono);font-size:13px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.function-name small{font-size:12px;color:var(--faint);flex-shrink:0}
.function-row select{width:230px;flex-shrink:0}
.function-auto{font-size:12px;color:var(--green);background:var(--green-soft);padding:3px 8px;border-radius:6px;flex-shrink:0}
@media(max-width:760px){.function-row{flex-wrap:wrap}.function-row select{width:100%}}

/* 一键接入：可选云端参数 */
.integrate-quick-guide{margin:14px 0 0;line-height:1.8}
.integrate-cloud-panel{margin:16px 0;border:1px solid var(--line);border-radius:12px;padding:14px}
.integrate-cloud-panel>summary{font-size:14px;font-weight:600;cursor:pointer;line-height:1.6}
.integrate-cloud-panel[open]>summary{margin-bottom:12px}
.integrate-cloud-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0}
.integrate-cloud-actions>select{flex:1;min-width:180px}
.integrate-cloud-literals{max-height:380px;overflow:auto;border-radius:8px}
.integrate-cloud-literals>.picker-empty{margin:8px 0}
.integrate-literal-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,240px);align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line-2)}
.integrate-literal-row:last-child{border-bottom:0}
.integrate-literal-title{display:flex;align-items:flex-start;gap:10px;margin:0;min-width:0}
.integrate-literal-title>input{width:16px;height:16px;flex:0 0 16px;margin-top:3px}
.integrate-literal-title>span{min-width:0;display:grid;gap:3px}
.integrate-literal-title code{font-family:var(--mono);font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}
.integrate-literal-title small{font-size:12px;color:var(--faint);line-height:1.5}
@media(max-width:760px){.integrate-literal-row{grid-template-columns:1fr}.integrate-cloud-actions>select{width:100%}.integrate-literal-row>select{width:100%}}

.integrate-auto-row{display:flex;align-items:flex-start;gap:10px;padding:12px 0;border-bottom:1px solid var(--line-2);margin:0}
.integrate-auto-row>input{width:16px;height:16px;flex:0 0 16px;margin-top:3px}
.integrate-auto-row>span{display:grid;gap:4px;min-width:0}
.integrate-auto-row code{font-family:var(--mono);font-size:12px;overflow-wrap:anywhere}
.integrate-auto-row small{color:var(--faint);font-size:12px;overflow-wrap:anywhere}
.integrate-cloud-advanced{margin-top:14px}
.integrate-cloud-advanced>summary{cursor:pointer;color:var(--muted);font-size:13px}
.integrate-cloud-actions[hidden]{display:none}

/* 云端参数按软件收起；展开后仍保留原表格及操作。 */
.remote-values-table.variables-collapsed{min-width:0}
.remote-values-table.variables-collapsed thead{display:none}
#variables-body tr[hidden]{display:none!important}
#variables-body .variable-group-heading td{padding:0;background:var(--surface)}
.variable-group-bar{display:flex;align-items:center;min-width:0}
.variable-group-toggle{display:flex;align-items:center;flex:1;min-width:0;gap:12px;padding:18px 20px;background:var(--surface);color:var(--ink);text-align:left;border:0;border-radius:0;white-space:normal;cursor:pointer}
.variable-group-batch{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:12px 20px 12px 0;flex-shrink:0}
.variable-group-batch .row-action{white-space:nowrap}
.variable-group-toggle:hover{background:var(--hover)}
.variable-group-toggle:focus-visible{outline:2px solid var(--ink);outline-offset:-3px}
.variable-group-chevron{width:7px;height:7px;flex-shrink:0;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);transition:transform .15s}
.variable-group-toggle[aria-expanded="true"] .variable-group-chevron{transform:rotate(45deg)}
.variable-group-name{font-size:14px;font-weight:600;overflow-wrap:anywhere}
.variable-group-count{font-size:12px;color:var(--muted);font-weight:400}
.variable-group-action{margin-left:auto;font-size:13px;color:var(--muted);flex-shrink:0}
.variable-batch-scope{margin:0 0 12px;color:var(--muted);overflow-wrap:anywhere}
.variable-batch-count{margin:0 0 14px;padding:12px 14px;background:var(--bg);border:1px solid var(--line);border-radius:10px;font-weight:600;line-height:1.6}
.variable-batch-confirmation{display:grid;gap:8px;margin:18px 0;font-size:13px;line-height:1.6}
.variable-batch-confirmation[hidden]{display:none}
.variable-batch-confirmation input{width:100%;font-family:var(--mono)}
.variable-batch-dialog .modal-actions{flex-wrap:wrap}
@media(max-width:760px){.variable-group-bar{align-items:stretch;flex-direction:column}.variable-group-toggle{padding:16px 14px;gap:9px;flex-wrap:wrap}.variable-group-count{font-size:11px}.variable-group-batch{padding:0 14px 14px}.variable-batch-dialog .modal-actions .button{flex:1;white-space:normal}}

/* 一键接入：按用途选择，保留用户原选择。 */
.integrate-mode-guide{margin-top:16px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--bg);font-size:13px;line-height:1.65}
.integrate-mode-guide strong{display:block;margin-bottom:6px;color:var(--ink)}
.integrate-mode-guide p{margin:5px 0;color:var(--muted)}
.integrate-mode-guide .field-hint{margin-top:8px;font-size:12px}
.function-choice{width:330px;max-width:100%;flex-shrink:0;display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.function-choice select{width:100%}
.function-choice-hint{margin:0;color:var(--muted);font-size:12px;line-height:1.6;overflow-wrap:anywhere}
@media(max-width:760px){.function-choice{width:100%}.function-name{flex-wrap:wrap}}
/* 一键接入：异步云函数与证书配置，沿用后台表单样式。 */
.integrate-function-fields{display:grid;gap:14px;margin:14px 0}
.integrate-function-fields[hidden],.integrate-tls-review[hidden]{display:none}
.integrate-function-fields label,.integrate-tls-panel>label{display:grid;gap:8px;margin:12px 0}
.integrate-function-fields textarea,.integrate-tls-panel textarea{box-sizing:border-box;width:100%;min-height:110px;padding:12px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.integrate-function-fields select{width:100%;min-height:42px}
.integrate-check-label{display:flex!important;align-items:flex-start;gap:9px!important;font-weight:400}
.integrate-check-label input[type="checkbox"]{flex:0 0 18px;width:18px;min-width:18px;max-width:18px;height:18px;min-height:18px;padding:0;margin:3px 0 0;box-shadow:none;accent-color:var(--ink)}
.integrate-check-label>span{flex:1 1 0;min-width:0;line-height:1.6;white-space:normal;overflow-wrap:anywhere}
.integrate-tls-value{white-space:pre-wrap;overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.65}
.integrate-tls-actions,.integrate-tls-review{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.integrate-tls-review{padding:14px;border:1px solid var(--line,#e5e7eb);border-radius:12px;background:var(--surface,#fff)}
.integrate-tls-review p{width:100%;margin:0 0 4px}
.integrate-tls-rotation{margin-top:14px}.integrate-tls-rotation summary{cursor:pointer;font-weight:600}.integrate-tls-rotation>label{margin:12px 0}
.integrate-integrity-list{max-height:420px;overflow:auto;margin-top:14px}
.integrate-integrity-release{display:flex;align-items:flex-start;gap:10px;padding:14px 0;margin:0;border-top:1px solid var(--line)}
.integrate-integrity-release>input{flex:0 0 18px;width:18px;height:18px;margin:3px 0 0}
.integrate-integrity-release>span{display:grid;gap:6px;min-width:0}.integrate-integrity-release code{font-family:var(--mono);overflow-wrap:anywhere;user-select:text}.integrate-integrity-release small{color:var(--muted)}
@media(max-width:760px){.integrate-tls-actions>button{flex:1 1 160px}.integrate-tls-value{font-size:11px}}

/* 文件哈希独立管理页；手动输入保持在折叠区中。 */
.integrity-page-card { padding: 24px; display: grid; gap: 18px; }
.integrity-page-card > label { display: grid; gap: 8px; }
.integrity-manual { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 16px; }
.integrity-manual > summary { cursor: pointer; font-weight: 600; }
.integrity-manual[open] > summary { margin-bottom: 16px; }
.integrity-manual .integrate-fields { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.integrity-manual .integrate-fields > label { display: grid; gap: 8px; }
@media (max-width: 640px) { .integrity-page-card { padding: 16px; } .integrity-manual .integrate-fields { grid-template-columns: 1fr; } }

/* 守卫历史表单独约束列宽，避免完整 SHA-256 覆盖观察次数、状态和删除按钮。 */
#guard-policy-panel .table-wrap{overflow-x:auto}
#guard-policy-panel table{table-layout:fixed;min-width:1120px}
#guard-policy-panel th:nth-child(1),#guard-policy-panel td:nth-child(1){width:64px}
#guard-policy-panel th:nth-child(2),#guard-policy-panel td:nth-child(2){width:100px}
#guard-policy-panel th:nth-child(3),#guard-policy-panel td:nth-child(3){width:180px}
#guard-policy-panel th:nth-child(4),#guard-policy-panel td:nth-child(4){width:90px}
#guard-policy-panel th:nth-child(5),#guard-policy-panel td:nth-child(5){width:420px}
#guard-policy-panel th:nth-child(6),#guard-policy-panel td:nth-child(6){width:100px}
#guard-policy-panel th:nth-child(7),#guard-policy-panel td:nth-child(7){width:120px}
#guard-policy-panel th:nth-child(8),#guard-policy-panel td:nth-child(8){width:100px}
#guard-policy-rows td:nth-child(5) code{max-width:none!important;white-space:normal;overflow-wrap:anywhere;word-break:break-all}
#guard-policy-rows td:nth-child(6),#guard-policy-rows td:nth-child(7),#guard-policy-rows td:nth-child(8){white-space:nowrap}

/* 云函数为可见的独立步骤；所属应用不藏在云端参数折叠区。 */
.integrate-app-scope{display:grid;gap:8px;margin:16px 0;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.integrate-app-scope>label{margin:0}
.integrate-function-panel .step{margin-bottom:12px}
.integrate-function-panel .integrate-function-app{font-weight:500;overflow-wrap:anywhere}
.integrate-function-panel .integrate-function-fields{margin:12px 0;gap:10px}
.integrate-function-panel .integrate-function-fields>label{margin:0}
.integrate-function-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
#view-functions .page-heading,#view-function-edit .page-heading{flex-wrap:wrap;gap:14px}
@media(max-width:640px){.integrate-function-actions>button{flex:1 1 140px}.integrate-function-panel .step{align-items:flex-start}.integrate-function-panel .step>div{min-width:0}}
/* 应用生命周期与哈希总览：移动端仍完整显示应用与版本。 */
#apps-lifecycle-filter{width:auto;min-width:180px;max-width:100%}
.app-lifecycle-dialog .modal-content{padding:0}
.app-lifecycle-dialog p{line-height:1.8;overflow-wrap:anywhere}
.integrity-overview{padding:18px 20px;margin-bottom:20px}
.integrity-overview .panel-heading{padding:0 0 10px;gap:12px;flex-wrap:wrap}
.integrity-overview-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.integrity-overview-app{display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);min-width:0;cursor:pointer}
.integrity-overview-app:hover,.integrity-overview-app:focus-visible{border-color:var(--ink)}
.integrity-overview-app>*{max-width:100%;overflow-wrap:anywhere}
@media(max-width:640px){.integrity-overview-list{grid-template-columns:1fr}.integrity-overview{padding:16px}#view-apps .panel-heading{flex-wrap:wrap;gap:12px}}
.integrity-capture{margin:14px 0;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.integrity-capture h3{margin:0 0 8px;font-size:14px}
.integrity-capture select{max-width:100%;text-overflow:ellipsis}
.integrity-capture .field-hint{overflow-wrap:anywhere}

/* 云函数生成结果：可直接复制的调用入口。 */
.integrate-cloud-entry { margin-bottom: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt, #f8f8fa); min-width: 0; }
.integrate-cloud-entry-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; min-width: 0; }
.integrate-cloud-entry-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.integrate-cloud-entry-row button { flex-shrink: 0; }
.integrate-cloud-entry .field-hint { margin-bottom: 0; }
@media (max-width: 640px) { .integrate-cloud-entry-row { align-items: stretch; flex-direction: column; } .integrate-cloud-entry-row button { width: 100%; } }

.managed-cloud-dialog{width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid var(--line,#e5e7eb);border-radius:18px;padding:24px;background:var(--panel,#fff);color:var(--text,#18181b)}
.managed-cloud-dialog::backdrop{background:#18181b55;backdrop-filter:blur(3px)}
.managed-cloud-form{display:flex;flex-direction:column;gap:14px;min-width:0}
.managed-cloud-form>label:not(.managed-cloud-check){display:flex;flex-direction:column;gap:7px;font-weight:500}
.managed-cloud-form label[hidden],.managed-cloud-form p[hidden]{display:none}
.managed-cloud-form input:not([type=checkbox]),.managed-cloud-form select,.managed-cloud-form textarea{width:100%;min-width:0;box-sizing:border-box}
.managed-cloud-form textarea{min-height:140px;resize:vertical}
.managed-cloud-form .managed-cloud-check{display:flex;align-items:center;gap:9px;line-height:1.6}
.managed-cloud-check input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;margin:0;padding:0}
.managed-cloud-form p{margin:0;overflow-wrap:anywhere}
.managed-cloud-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:8px}
#managed-cloud-filter{max-width:200px}
@media(max-width:600px){.managed-cloud-dialog{padding:18px}.managed-cloud-actions .button{flex:1}#view-functions .page-heading{gap:12px;align-items:flex-start;flex-wrap:wrap}}

/* 代理账户、余额充值卡与按应用划分的制卡权限。 */
.wallet-panel-body{padding:18px 20px;min-width:0}
.wallet-panel-body>p{line-height:1.8;margin:6px 0 12px}
.wallet-portal-panel{margin-bottom:18px;background:#f7f9fc;border-color:#dce3ee}
.wallet-portal-address{display:flex;align-items:center;gap:10px;min-width:0;margin-top:10px}
.wallet-portal-address code{display:block;padding:10px 13px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:13px;overflow-wrap:anywhere;min-width:0;user-select:text}
.wallet-portal-address .button{flex-shrink:0}
.agent-permission-section{margin-top:18px}
.agent-permission-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:11px;overflow:hidden;margin-top:10px}
.agent-permission-row{display:grid;grid-template-columns:minmax(100px,180px) 1fr;align-items:start;gap:16px;padding:15px 16px;border-bottom:1px solid var(--line);min-width:0}
.agent-permission-row:last-child{border-bottom:0}
.agent-permission-app{padding-top:7px;font-size:13px;overflow-wrap:anywhere}
.agent-permission-options{display:flex;flex-wrap:wrap;gap:7px;min-width:0}
.agent-permission-options>label{margin:0}
.agent-permission-options>label.unavailable{opacity:.48;cursor:not-allowed}
.agent-permission-options input:disabled+span{cursor:not-allowed}
.wallet-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:20px}
.wallet-stat{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:17px 19px;border:1px solid var(--line);border-radius:12px;background:#fff;min-width:0}
.wallet-stat>span{font-size:12px}.wallet-stat>strong{font-size:25px;font-weight:650;line-height:1.2;font-variant-numeric:tabular-nums}
.wallet-generate-panel,.wallet-result-panel{margin-bottom:20px}
.wallet-denominations{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.wallet-denominations>label{margin:0}
.wallet-custom-amount{max-width:400px;margin-top:17px}
.wallet-form-row{margin-top:18px}
.wallet-generate-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.wallet-generate-footer .muted{font-size:12px}
.wallet-inline-actions{display:flex;flex-wrap:wrap;align-items:center;gap:7px}
.wallet-toolbar{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line)}
.wallet-toolbar>div{min-width:150px}.wallet-toolbar .wallet-search{flex:1;min-width:200px}
.wallet-toolbar label{font-size:12px}
.wallet-selection{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:14px 20px;border-bottom:1px solid var(--line);font-size:12px}
.wallet-check{display:inline-flex;align-items:center;gap:8px;margin:0;white-space:nowrap}
.wallet-check input,.recharge-card-check{width:16px;height:16px;min-height:16px;padding:0;margin:0;accent-color:#18181b;cursor:pointer}
.wallet-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:15px 20px;font-size:12px}
.wallet-generated-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:16px 20px}
.wallet-generated-card{display:flex;align-items:center;gap:10px;padding:11px 12px;border:1px solid var(--line);border-radius:9px;min-width:0}
.wallet-generated-card>code{flex:1;font-size:12px;overflow-wrap:anywhere;user-select:all}
.wallet-generated-card>.muted{font-size:12px;white-space:nowrap}
.wallet-copy-source{display:block;width:calc(100% - 40px);min-height:110px;margin:0 20px 18px;padding:12px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;resize:vertical}
.wallet-card-code{font-size:12px;overflow-wrap:anywhere;user-select:all}
.wallet-money{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.wallet-positive{color:#16834a}.wallet-negative{color:#b4231f}
.wallet-adjust-dialog{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid var(--line);border-radius:16px;padding:24px;color:var(--ink);background:#fff;box-shadow:0 24px 80px #18181b26}
.wallet-adjust-dialog::backdrop{background:#18181b66;backdrop-filter:blur(3px)}
.wallet-adjust-dialog h2{margin:0 0 9px;font-size:19px}.wallet-adjust-dialog p{line-height:1.8}.wallet-adjust-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:23px}
#wallet-account-search{width:min(250px,100%)}
#view-users .panel-heading,#view-recharge .panel-heading{flex-wrap:wrap;gap:12px}
@media(max-width:900px){.wallet-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.agent-permission-row{grid-template-columns:1fr;gap:9px}.agent-permission-app{padding-top:0}.wallet-generated-list{grid-template-columns:1fr}}
@media(max-width:600px){.wallet-panel-body,.wallet-toolbar{padding:15px}.wallet-portal-address{align-items:stretch;flex-direction:column}.wallet-portal-address .button{width:100%}.wallet-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.wallet-stat{padding:13px}.wallet-stat>strong{font-size:22px}.wallet-toolbar>div,.wallet-toolbar .wallet-search{min-width:0;flex:1 1 100%}.wallet-toolbar>.button{width:100%}.wallet-selection,.wallet-pager{padding:13px 15px}.wallet-generated-list{padding:15px}.wallet-generated-card{flex-wrap:wrap}.wallet-generated-card>code{flex-basis:70%}.wallet-copy-source{margin-left:15px;width:calc(100% - 30px)}.wallet-generate-footer{align-items:stretch;flex-direction:column}.wallet-generate-footer>.button{width:100%}.agent-permission-row{padding:13px}.agent-permission-options>label>span{font-size:12px}}
