/* IP 管理 · web shell · 素白（2026-11-18 重写）
   The frame around the shared views, in the same material as cloud-exit.css: a
   light grey canvas, a quiet sidebar on that canvas (the current page is a white
   capsule), white cards with hairline edges, black capsules for the selected item
   and the main action. On phones: a white top bar and a full-screen drawer. */

html { background: #f5f5f7; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.ce-app.shell-body { --side-w: 212px; --page-pad: clamp(16px, 3vw, 40px); max-width: none; margin: 0; padding: 0; min-height: 100vh; background: var(--c-canvas); font-size: 14px; }
.shell-body a { color: inherit; }
.ce-app [hidden] { display: none !important; }
.shell-glyph { display: inline-flex; width: 18px; height: 18px; flex: none; }
.shell-glyph svg { width: 100%; height: 100%; display: block; }
.shell-grow { flex: 1 1 auto; }
.shell-dim { color: var(--c-label-3); }
.shell-text { font-size: 13.5px; line-height: 1.75; color: var(--c-label-2); }

/* ---------- frame ---------- */
body.shell-signed { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: auto 1fr; transition: grid-template-columns .22s cubic-bezier(.3,.7,.2,1); }
body.shell-signed.shell-mini { --side-w: 68px; }
body.shell-signed #shell-header { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; background: var(--c-canvas); z-index: 60; }
body.shell-signed #shell-header::-webkit-scrollbar { display: none; }
body.shell-signed #shell-status { grid-column: 2; grid-row: 1; }
body.shell-signed #main { grid-column: 2; grid-row: 2; }
#main { min-width: 0; width: 100%; max-width: 1480px; margin: 0 auto; padding: 30px var(--page-pad) 64px; outline: none; }
/* #main takes focus (tabindex=-1) when empty space is clicked; no focus ring for the page itself. */
#main:focus, #main:focus-visible { outline: none !important; }
#main > .ce-app { padding-top: 0; }
#main[data-page="account"] > *, #main[data-page="home"] > *, #main[data-page="updates"] > *, #main[data-page="notifications"] > * { max-width: min(100%, 1040px); }

/* brand + fold: rows keep their height and icon position in both widths */
.shell-top { position: relative; display: flex; align-items: center; height: 36px; padding: 0 40px 0 8px; }
.ce-app .shell-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--c-label); text-decoration: none; transition: opacity .15s; }
.shell-brand strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; transition: opacity .15s .05s; }
.shell-mark { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--c-ink-text); background: var(--c-ink); }
.shell-mark .shell-glyph { width: 17px; height: 17px; }
.ce-app .shell-fold { position: absolute; top: 4px; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: var(--c-label-3); cursor: pointer; transition: background-color .15s, color .15s, opacity .15s; }
.ce-app .shell-fold:hover { background: var(--c-fill); color: var(--c-label); }
.shell-fold .shell-glyph { width: 17px; height: 17px; }
.ce-app .shell-menu { display: none; }

/* drawer content */
.shell-drawer { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin-top: 18px; }
.shell-device { position: relative; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 12px 0 8px; border-radius: 14px; background: var(--c-surface); box-shadow: var(--sh-card); cursor: pointer; overflow: hidden; }
.shell-device-icon { position: relative; width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-fill); color: var(--c-label-2); flex: none; }
.shell-device-icon::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 2px var(--c-surface); }
.shell-device.shell-offline .shell-device-icon::after { background: var(--c-label-4); }
.shell-device-icon .shell-glyph { width: 17px; height: 17px; }
.shell-device-text { display: grid; min-width: 0; flex: 1; white-space: nowrap; transition: opacity .15s .05s; }
.shell-device-text small { font-size: 11px; color: var(--c-label-3); line-height: 1.35; }
.ce-app .shell-device-select { -webkit-appearance: none; appearance: none; width: 100%; padding: 0 18px 0 0; font-size: 13.5px; font-weight: 500; color: var(--c-label); cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.shell-device.shell-device-single { cursor: default; }
.shell-device-name { display: block; font-size: 13.5px; font-weight: 500; color: var(--c-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-device .shell-chev { position: absolute; right: 12px; top: 50%; margin-top: -6.5px; width: 13px; height: 13px; color: var(--c-label-3); pointer-events: none; transition: opacity .15s .05s; }
.shell-nav { display: flex; flex-direction: column; }
.shell-group-k { height: 18px; padding: 0 12px; margin: 20px 0 6px; font-size: 11.5px; font-weight: 500; line-height: 18px; color: var(--c-label-3); white-space: nowrap; overflow: hidden; transition: opacity .15s .05s; }
.ce-app .shell-link { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 12px; margin: 1px 0; border-radius: var(--r-pill); color: var(--c-label-2); font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; transition: background-color .15s, color .15s; }
.shell-link > span:not(.shell-glyph) { transition: opacity .15s .05s; }
.shell-link .shell-glyph { width: 17px; height: 17px; color: var(--c-label-3); transition: color .15s; }
.ce-app .shell-link:hover { background: var(--c-fill); color: var(--c-label); }
.ce-app .shell-link[aria-current=page] { background: var(--c-surface); box-shadow: var(--sh-card); color: var(--c-label); font-weight: 600; }
.shell-link[aria-current=page] .shell-glyph { color: var(--c-label); }
.shell-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 6px; }
.shell-me { display: flex; align-items: center; gap: 10px; height: 52px; padding: 12px 4px 0 8px; box-shadow: inset 0 1px 0 var(--c-line); white-space: nowrap; }
.shell-me .ce-avatar { width: 28px; height: 28px; font-size: 12px; }
.shell-me-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s .05s; }
.ce-app .ce-btn.shell-out { color: var(--c-label-2); transition: opacity .15s .05s, background-color .15s; }
.ce-app .ce-btn.shell-out:hover { background: var(--c-fill); color: var(--c-label); }
/* icon rail (desktop only): same rows, labels faded out */
@media (min-width: 901px) {
  .shell-mini .shell-brand strong, .shell-mini .shell-device-text, .shell-mini .shell-device .shell-chev, .shell-mini .shell-group-k,
  .shell-mini .shell-link > span:not(.shell-glyph), .shell-mini .shell-me-name, .ce-app.shell-mini .ce-btn.shell-out { opacity: 0; transition-delay: 0s; transition-duration: .1s; }
  .ce-app.shell-mini .ce-btn.shell-out { pointer-events: none; }
  .ce-app.shell-mini .shell-fold { opacity: 0; }
  .ce-app.shell-mini .shell-top:hover .shell-fold, .ce-app.shell-mini .shell-fold:focus-visible { opacity: 1; background: var(--c-fill); color: var(--c-label); }
  .ce-app.shell-mini .shell-top:hover .shell-brand { opacity: 0; }
  /* the rail is 40px inside its padding: every row is 40px wide with its icon centred (heights unchanged, nothing jumps), so
     the current page (white) and hover (grey) shapes line up with the icons */
  .shell-mini .shell-top { padding-left: 6px; }
  .shell-mini .shell-device { width: 40px; padding: 0 4px; border-radius: 12px; }
  .ce-app.shell-mini .shell-link { width: 40px; padding: 0 11.5px; gap: 0; border-radius: 11px; }
  .shell-mini .shell-me { padding-left: 6px; }
}

/* signed-out pages */
body:not(.shell-signed) #shell-header { display: flex; justify-content: center; padding: 11vh 16px 0; }
body:not(.shell-signed) .shell-top { padding: 0; }
body:not(.shell-signed) .shell-mark { width: 34px; height: 34px; border-radius: 10px; }
body:not(.shell-signed) .shell-brand strong { font-size: 18px; }

/* ---------- status line ---------- */
#shell-status:empty { display: none; }
#shell-status { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; width: calc(100% - 2 * var(--page-pad)); max-width: calc(1480px - 2 * var(--page-pad)); margin: 18px auto 0; padding: 10px 16px; min-height: 44px; border-radius: 14px; background: var(--c-surface); box-shadow: var(--sh-card); color: var(--c-orange-text); font-size: 13px; }
#shell-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c-orange); flex: none; }
.shell-status-text { flex: 1 1 auto; }
body.shell-signed #shell-status + #main { padding-top: 22px; }

/* ---------- page header: title left, actions right ---------- */
.shell-head, #main .ce-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.shell-head-text, #main .ce-hero-text { display: grid; gap: 4px; min-width: 0; }
.shell-body .ce-title, #main .ce-hero .ce-title { font-size: 28px; font-weight: 600; letter-spacing: -.022em; line-height: 1.15; margin: 0; }
.shell-head-sub, #main .ce-hero-sub { font-size: 13px; color: var(--c-label-3); margin: 0; }
.shell-head-side, #main .ce-hero-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#main[data-page="settings"] .ce-strip, #main[data-page="tasks"] .ce-strip { display: none; }
#main[data-page="settings"] .ce-body { max-width: 920px; }

/* sub-navigation: the same capsule tray as every segmented control */
.shell-seg { display: inline-flex; gap: 2px; width: max-content; max-width: 100%; margin: 0 0 20px; padding: 3px; border-radius: var(--r-pill); background: var(--c-surface); box-shadow: var(--sh-ctl); overflow-x: auto; scrollbar-width: none; }
.shell-seg::-webkit-scrollbar { display: none; }
.ce-app .shell-seg a { flex: none; display: inline-flex; align-items: center; height: 30px; padding: 0 15px; border-radius: var(--r-pill); color: var(--c-label-2); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: color .15s, background-color .18s; }
.ce-app .shell-seg a:hover { color: var(--c-label); }
.ce-app .shell-seg a[aria-current=page] { background: var(--c-ink); color: var(--c-ink-text); }

/* ---------- panels, lists, stats ---------- */
.shell-panel { padding: 20px 22px; }
.shell-panel + .shell-panel, .shell-stats-panel + .shell-panel { margin-top: 12px; }
.shell-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.shell-panel-head .ce-h2 { margin: 0; font-size: 16px; }
.shell-panel-head .ce-caption { margin-top: 4px; font-size: 12.5px; color: var(--c-label-3); line-height: 1.55; }
.shell-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.shell-panel-note { margin-top: 20px !important; padding-top: 16px; box-shadow: inset 0 1px 0 var(--c-line); font-size: 12.5px !important; color: var(--c-label-3) !important; }
.shell-empty { padding: 40px 16px; text-align: center; font-size: 13px; color: var(--c-label-3); }
.shell-diagnostic-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px 20px; margin: 12px 0 20px; }
.shell-diagnostic-meta dt { color: var(--c-label-3); font-size: 12px; }
.shell-diagnostic-meta dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.shell-diagnostic-data > summary { cursor: pointer; }
.shell-diagnostic-data pre { max-height: 55vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.shell-copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.shell-list { display: flex; flex-direction: column; margin: 0 -22px; }
.shell-list > * + * { box-shadow: inset 0 1px 0 var(--c-line); }
.shell-list:last-child { margin-bottom: -20px; }
.shell-li { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 13px 22px; min-height: 60px; transition: background-color .15s; }
.shell-li:hover { background: var(--c-hover); }
.shell-li-main { flex: 1 1 200px; min-width: 0; display: grid; gap: 3px; }
.shell-li-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.shell-li-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--c-label-3); }
.shell-li-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shell-li-acts { display: flex; align-items: center; gap: 4px; }
.shell-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.shell-chips .ce-chip-s { height: 28px; padding: 0 11px; box-shadow: none; background: var(--c-fill); }
.ce-app .shell-qty { width: 88px; flex: none; }
/* number rows: the same small white cards as the dashboard */
.shell-stats-panel { padding: 0; background: none !important; box-shadow: none !important; overflow: visible; }
.shell-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.shell-stat { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 16px 18px; border-radius: var(--r-card); background: var(--c-surface); box-shadow: var(--sh-card); }
.shell-panel .shell-stat { background: var(--c-fill); box-shadow: none; border-radius: var(--r-tile); padding: 14px 16px; }
.shell-stats-panel .shell-stat { background: var(--c-surface); box-shadow: var(--sh-card); border-radius: var(--r-card); padding: 16px 18px; }
.shell-stat-k { font-size: 13px; color: var(--c-label-2); }
.shell-stat-v { font-size: 26px; font-weight: 500; letter-spacing: -.022em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.shell-stat-n { font-size: 12px; color: var(--c-label-3); }
.shell-stat-v.shell-green { color: var(--c-green-text); } .shell-stat-v.shell-orange { color: var(--c-orange-text); }
.shell-meter { height: 6px; margin: 20px 0 4px; border-radius: var(--r-pill); background: var(--c-fill-2); overflow: hidden; }
.shell-meter i { display: block; height: 100%; border-radius: inherit; background: var(--c-ink); transition: width .4s ease; }

/* time-limited slots */
.shell-grants { display: grid; gap: 4px; }
.shell-meter + .shell-grants { margin-top: 16px; }
.shell-grant-li { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 12px; border-radius: 10px; background: var(--c-fill); font-size: 13px; }
.shell-grant-li .ce-num { min-width: 34px; font-weight: 600; }
.shell-grant-plan { font-weight: 500; }
.shell-grant-src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.shell-grant-off { opacity: .5; }
.shell-grant-cut { font-size: 12px; color: var(--c-red-text); font-variant-numeric: tabular-nums; }
/* choice capsules (durations, payment methods): white, the choice outlined in black */
.shell-pay-methods { display: flex; gap: 8px; flex-wrap: wrap; }
.ce-app .shell-pay-method { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--c-surface); box-shadow: var(--sh-ctl); color: var(--c-label); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: box-shadow .15s, background-color .15s; }
.ce-app .shell-pay-method[aria-checked="true"] { box-shadow: 0 0 0 2px var(--c-ink); }
.shell-pay-method i { width: 18px; height: 18px; border-radius: 6px; flex: none; }
.shell-pay-alipay i { background: #1677ff; } .shell-pay-wxpay i { background: #07c160; }
.ce-app .shell-durations .shell-duration { flex-direction: column; justify-content: center; gap: 1px; height: auto; min-height: 50px; min-width: 84px; padding: 6px 16px; border-radius: 16px; line-height: 1.2; }
.ce-app .shell-durations .shell-duration small { font-size: 11.5px; font-weight: 400; color: var(--c-label-3); font-variant-numeric: tabular-nums; }
.shell-pay-total { align-self: flex-end; padding-bottom: 9px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.shell-pay-qr { display: block; width: 220px; height: 220px; margin: 4px auto 18px; border-radius: 14px; box-shadow: var(--sh-ctl); object-fit: contain; background: #fff; }
.shell-pay-switches { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.shell-buy { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; box-shadow: inset 0 1px 0 var(--c-line); }
.shell-buy-k { display: grid; gap: 7px; font-size: 13px; font-weight: 500; color: var(--c-label); }
.shell-buy-wide { flex: 1 1 100%; }

/* ---------- 用户与名额 ---------- */
.shell-acct-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ce-app .shell-user-search { width: 220px; height: 34px; border-radius: var(--r-pill); padding: 0 14px; }
.shell-acct-list { display: flex; flex-direction: column; margin: 0 -22px -20px; }
.shell-acct + .shell-acct { box-shadow: inset 0 1px 0 var(--c-line); }
.shell-acct-row { display: flex; align-items: center; min-height: 64px; }
.shell-acct-pick { display: flex; align-items: center; justify-content: center; width: 52px; flex: none; align-self: stretch; padding-left: 8px; }
.ce-app .shell-acct-open { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(150px, 1.6fr) 84px minmax(120px, 1fr) minmax(130px, 1fr) 96px 18px; align-items: center; gap: 16px; align-self: stretch; padding: 10px 22px 10px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ce-app .shell-acct-row:not(.shell-acct-th) { transition: background-color .15s; }
.ce-app .shell-acct-row:not(.shell-acct-th):hover { background: var(--c-hover); }
.shell-acct-th { min-height: 38px; box-shadow: inset 0 -1px 0 var(--c-line); }
.ce-app .shell-acct-th .shell-acct-open { cursor: default; padding-top: 0; padding-bottom: 0; font-size: 12px; color: var(--c-label-3); }
.shell-acct-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shell-acct-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.shell-acct-name strong { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-acct-cap { display: grid; line-height: 1.15; }
.shell-acct-cap strong { font-size: 18px; font-weight: 500; }
.shell-acct-cap small { font-size: 11px; color: var(--c-label-3); }
.shell-acct-th .shell-acct-cap, .shell-acct-th .shell-usage { display: block; }
.shell-usage { display: grid; gap: 6px; font-size: 12.5px; color: var(--c-label-2); }
.shell-usage i { display: block; height: 5px; border-radius: var(--r-pill); background: var(--c-fill-2); overflow: hidden; }
.shell-usage b { display: block; height: 100%; border-radius: inherit; background: var(--c-ink); }
.shell-usage.shell-over { color: var(--c-orange-text); }
.shell-usage.shell-over b { background: var(--c-orange); }
.shell-acct-exp, .shell-acct-dev { font-size: 12.5px; color: var(--c-label-2); font-variant-numeric: tabular-nums; }
.shell-acct-exp.shell-soon { color: var(--c-orange-text); font-weight: 500; }
.shell-acct-chev { font-size: 20px; line-height: 1; color: var(--c-label-3); transition: transform .2s; justify-self: end; }
.shell-acct-open[aria-expanded="true"] .shell-acct-chev { transform: rotate(90deg); }
.shell-acct-on { background: var(--c-surface-2); }
.shell-acct-detail { display: grid; gap: 16px; padding: 4px 22px 20px 52px; }
.shell-acct-fresh { animation: shell-drop .18s ease; }
.shell-acct-sec { display: grid; gap: 8px; }
.shell-acct-sec .shell-grant-li { background: var(--c-surface); box-shadow: var(--sh-ctl); }
.shell-acct-k { font-size: 12px; font-weight: 500; color: var(--c-label-3); }
.shell-acct-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shell-selbar { position: sticky; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: min(100%, 760px); margin: 18px auto 0; padding: 10px 12px 10px 20px; border-radius: 22px; background: var(--c-surface); box-shadow: var(--sh-pop); animation: shell-rise .22s cubic-bezier(.3,.7,.2,1); }
@keyframes shell-rise { from { opacity: 0; transform: translateY(12px); } }
.shell-selbar-n { display: flex; align-items: baseline; gap: 4px; font-size: 14px; }
.shell-selbar-n strong { font-size: 17px; font-weight: 600; }
.shell-selbar-n small { margin-left: 8px; font-size: 12px; color: var(--c-label-3); }
.shell-sheet { gap: 18px; }
.shell-sheet-k { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px; }
.shell-sheet-k .shell-field-k { font-size: 13px; font-weight: 500; color: var(--c-label-2); }
.shell-sheet-k .shell-durations { flex-wrap: wrap; }
.shell-step { display: inline-flex; align-items: center; width: max-content; padding: 2px; border-radius: var(--r-pill); background: var(--c-fill); }
.ce-app .shell-step-b { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--c-label); font-size: 18px; cursor: pointer; }
.ce-app .shell-step-b:hover { background: var(--c-surface); box-shadow: var(--sh-ctl); }
.ce-app .shell-step .shell-step-in { width: 64px; height: 34px; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.shell-step-in::-webkit-inner-spin-button, .shell-step-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.shell-sheet-sum { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-tile); background: var(--c-fill); font-size: 13px; }
.shell-sheet-sum strong { font-size: 20px; font-weight: 600; }
.shell-red-num { color: var(--c-red-text); }
.shell-preview { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; padding: 4px; border-radius: var(--r-tile); background: var(--c-fill); }
.shell-preview-li { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 2px 8px; font-size: 13px; }
.shell-preview-name { min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.shell-preview-more { padding: 6px 8px; font-size: 12px; }
.shell-plans { display: grid; }
.shell-plan { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 2px; box-shadow: inset 0 -1px 0 var(--c-line); cursor: pointer; }
.shell-plan:last-child { box-shadow: none; }
.shell-plan-k { font-size: 14px; font-weight: 500; }
.ce-app .shell-plan .shell-qty { width: 110px; text-align: right; }

/* ---------- notifications ---------- */
.shell-notify-icon { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 14px; font-weight: 600; color: #fff; }
.shell-notify-wechat_work { background: #2b7de9; } .shell-notify-feishu { background: #3370ff; } .shell-notify-server_chan { background: #10a37f; }
.shell-notify-pushplus { background: #f08a24; } .shell-notify-qq_bot { background: #12b7f5; }
.shell-notify-off .shell-notify-icon { filter: grayscale(1); opacity: .45; }
.shell-notify-off .shell-li-title > span:first-child { color: var(--c-label-3); }
.shell-notify-dot { width: 8px; height: 8px; margin: 0 6px 0 2px; border-radius: 50%; flex: none; background: var(--c-orange); }
.shell-notify-dot.shell-notify-ok { background: var(--c-green); }
.shell-notify-help { margin: -6px 0 0; }
.shell-rule { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0; cursor: pointer; }
.shell-rule .shell-check { flex: none; margin-top: 3px; }
.shell-rule-text { display: grid; gap: 3px; }
.shell-rule-text strong { font-size: 14px; font-weight: 500; }
.shell-rule-text small { font-size: 12.5px; color: var(--c-label-3); line-height: 1.6; }
.shell-rule-detail { display: flex; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin: 14px 0 0 28px; }
#main[data-page="notifications"] .shell-panel > .shell-field, #main[data-page="notifications"] .shell-panel > .shell-rule + .shell-field { margin: 14px 0; max-width: 360px; }

/* ---------- control console ---------- */
#main[data-page="admin"] > * { max-width: min(100%, 1240px); }
#main[data-page="admin"] > * + * { margin-top: 12px; }

/* ---------- forms ---------- */
.shell-form { display: grid; gap: 18px; max-width: 560px; }
.shell-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; }
.shell-form-grid.shell-form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shell-field { display: grid; gap: 7px; min-width: 0; }
.shell-field-label { display: grid; gap: 7px; min-width: 0; }
.shell-field-k { font-size: 13px; font-weight: 500; color: var(--c-label); }
.shell-field-hint { font-size: 12px; color: var(--c-label-3); line-height: 1.5; }
.ce-app .shell-field .ce-input, .ce-app .shell-buy .ce-input { height: 40px; }
.ce-app .shell-buy .ce-btn { height: 40px; }
.shell-select-wrap { position: relative; display: block; }
.ce-app .shell-select { -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer; background-image: none; }
.shell-select-wrap .shell-glyph { position: absolute; right: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: var(--c-label-3); pointer-events: none; }
.ce-app .shell-file { font-size: 13px; color: var(--c-label-2); }
.ce-app .shell-file::file-selector-button { margin-right: 12px; height: 34px; padding: 0 15px; border: 0; border-radius: var(--r-pill); background: var(--c-fill); color: var(--c-label); font: inherit; font-weight: 500; cursor: pointer; }
.shell-affix { display: flex; min-width: 0; }
.ce-app .shell-affix .ce-input { flex: 1; min-width: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.shell-suffix { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--c-fill-2); color: var(--c-label-2); font-size: 13.5px; white-space: nowrap; }
.shell-domain-url { display: grid; gap: 4px; margin-bottom: 18px; padding: 14px 16px; border-radius: var(--r-tile); background: var(--c-fill); }
.shell-domain-url:empty { display: none; }
.shell-domain-url a { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.shell-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shell-actions .ce-caption { flex: 1 1 100%; }
.shell-check-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.ce-app .shell-check { width: 16px; height: 16px; accent-color: var(--c-ink); }
.shell-error { font-size: 13px; color: var(--c-red-text); white-space: pre-line; overflow-wrap: anywhere; }
.shell-error:empty { display: none; }
.shell-codes { display: grid; gap: 8px; margin-bottom: 20px; }
.shell-codes code { display: block; padding: 12px 14px; border-radius: var(--r-tile); background: var(--c-fill); font: 500 14px var(--f-mono); user-select: all; overflow-wrap: anywhere; }
.shell-codes .shell-code-big { font-size: 28px; letter-spacing: .14em; text-align: center; }

/* ---------- standalone cards (sign-in, setup, errors) and dialogs ---------- */
.shell-card { width: 100%; max-width: 400px; margin: 28px auto; padding: 34px 30px 28px; border-radius: var(--r-sheet); background: var(--c-surface); box-shadow: var(--sh-card); }
.shell-card-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.shell-card-sub { margin: 8px 0 24px !important; font-size: 13px; line-height: 1.65; color: var(--c-label-3); }
.shell-card .shell-form { max-width: none; }
.ce-app .ce-btn.shell-submit { width: 100%; height: 42px; margin-top: 4px; font-size: 14px; }
.shell-alt { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 16px; font-size: 13px; color: var(--c-label-2); }
#modal_overlay { position: fixed; inset: 0; z-index: 900; overflow-y: auto; background: rgba(0,0,0,.32); padding: 28px 16px; }
.modal { width: 100%; max-width: 560px; margin: 6vh auto; padding: 0; background: var(--c-surface, #fff); border-radius: var(--r-sheet, 24px); box-shadow: var(--sh-pop); animation: ce-sheet-in .24s cubic-bezier(.2,.8,.2,1); }
.modal > h4 { display: none; }
.modal .shell-card { margin: 0; max-width: none; box-shadow: none; }

/* ---------- loading and toasts ---------- */
.shell-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18vh 0; color: var(--c-label-3); font-size: 13px; }
.shell-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--c-fill-2); border-top-color: var(--c-label-2); animation: shell-spin .7s linear infinite; }
@keyframes shell-spin { to { transform: rotate(360deg); } }
#notifications { position: fixed; right: 24px; bottom: 24px; z-index: 2100000; display: grid; gap: 8px; max-width: min(400px, calc(100vw - 32px)); }
.shell-toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill); background: #1d1d1f; box-shadow: 0 12px 32px -8px rgba(0,0,0,.35); font: 500 13px var(--f-sans, sans-serif); color: #f5f5f7; animation: shell-toast .25s cubic-bezier(.2,.8,.2,1); }
.shell-toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #30d158; flex: none; }
.shell-toast.error::before { background: #ff453a; }
@keyframes shell-toast { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes shell-drop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) { .ce-app.shell-body { --side-w: 200px; } }
@media (max-width: 900px) {
  .ce-app .shell-acct-open { grid-template-columns: minmax(0, 1fr) 64px minmax(96px, .8fr) 18px; }
  .shell-acct-exp, .shell-acct-dev { display: none; }
  body.shell-signed { display: block; }
  /* No backdrop-filter: it would become the containing block of the fixed drawer. */
  body.shell-signed #shell-header { position: sticky; top: 0; height: auto; padding: 10px 12px 10px 16px; overflow: visible; background: var(--c-surface); box-shadow: inset 0 -1px 0 var(--c-line); }
  .ce-app .shell-fold { display: none; }
  .shell-top { justify-content: space-between; padding: 0; }
  .ce-app .shell-menu { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 38px; height: 38px; padding: 0 11px; border-radius: 50%; cursor: pointer; }
  .ce-app .shell-menu:hover { background: var(--c-fill); }
  .shell-menu i { display: block; height: 1.75px; border-radius: 2px; background: var(--c-label); transition: transform .2s ease; }
  .shell-open .shell-menu i:first-child { transform: translateY(3.4px) rotate(45deg); }
  .shell-open .shell-menu i:last-child { transform: translateY(-3.4px) rotate(-45deg); }
  body.shell-signed .shell-drawer { display: none; position: fixed; left: 0; right: 0; top: 58px; bottom: 0; margin: 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; background: var(--c-canvas); animation: shell-drop .2s ease; }
  body.shell-signed .shell-open .shell-drawer { display: flex; }
  .ce-app .shell-link { height: 46px; font-size: 15px; padding: 0 14px; }
  body.shell-locked { overflow: hidden; }
  #shell-status { width: calc(100% - 32px); margin-top: 14px; }
  #main { padding: 20px 16px 44px; }
  .shell-body .ce-title, #main .ce-hero .ce-title { font-size: 26px; }
  #main .ce-hero, .shell-head { margin-bottom: 16px; }
}
@media (max-width: 600px) {
  .shell-acct-list { margin: 0 -16px -16px; }
  .shell-acct-pick { width: 44px; padding-left: 4px; }
  .ce-app .shell-acct-open { grid-template-columns: minmax(0, 1fr) 52px 18px; gap: 10px; padding-right: 14px; }
  .shell-acct-row .shell-usage, .shell-acct-who .ce-avatar { display: none; }
  .shell-acct-detail { padding: 4px 16px 18px; }
  .shell-acct-tools .ce-seg { width: 100%; }
  .ce-app .shell-user-search { width: 100%; }
  .shell-selbar { bottom: 12px; padding: 10px 12px; border-radius: 20px; }
  .shell-selbar .shell-grow { display: none; }
  .shell-selbar-n { flex: 1 1 auto; }
  .shell-selbar > .ce-btn:not(.ce-text) { flex: 1 1 28%; padding: 0 8px; }
  .shell-sheet-k { grid-template-columns: 1fr; gap: 6px; }
  .shell-form-grid, .shell-form-grid.shell-form-grid-2 { grid-template-columns: 1fr; }
  .shell-panel { padding: 16px; }
  .shell-list { margin: 0 -16px; }
  .shell-list:last-child { margin-bottom: -16px; }
  .shell-li { padding-left: 16px; padding-right: 16px; }
  .ce-app .shell-durations .shell-duration { min-width: 0; flex: 1 1 28%; }
  .shell-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shell-stat { padding: 13px 14px; }
  .shell-stat-v { font-size: 21px; }
  .shell-seg { width: 100%; }
  .ce-app .shell-seg a { flex: 1 0 auto; justify-content: center; padding: 0 12px; }
  .shell-card { padding: 28px 20px 22px; margin-top: 12px; }
  #notifications { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .modal { margin: 10vh 0 0; border-radius: 26px 26px 0 0; }
  #modal_overlay { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* First sign-in: login / register, and what to restore. */
.shell-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0 0 18px; padding: 3px; border-radius: var(--r-pill); background: var(--c-fill, rgba(0,0,0,.05)); }
.ce-app .shell-tab, .shell-tab { height: 32px; border: 0; border-radius: var(--r-pill); background: none; color: var(--c-label-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ce-app .shell-tab[aria-selected=true], .shell-tab[aria-selected=true] { background: var(--c-surface); color: var(--c-label); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.shell-tab:focus-visible { outline: 2px solid var(--c-label-2); outline-offset: 1px; }
.shell-ask { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 18px; background: var(--c-surface); color: var(--c-label); box-shadow: 0 20px 60px rgba(0,0,0,.22); }
.shell-ask::backdrop { background: rgba(0,0,0,.32); }
.shell-ask h2 { margin: 0 0 8px; font-size: 17px; }
.shell-ask p { margin: 0 0 20px; color: var(--c-label-2); font-size: 14px; line-height: 1.6; }
