.lite-mobile-title,
.lite-mobile-back-link,
.lite-mobile-home-nav,
.lite-mobile-module-menu,
.lite-mobile-settings-header,
.lite-mobile-bookmark-dock,
.lite-mobile-summary-tools,
.lite-mobile-reader-dock,
.lite-mobile-archive-back,
.lingxi-settings-back,
.reader-empty > .lite-mobile-action { display: none; }

html:is([data-lite-mobile-page], [data-auth-document]) {
  --lite-surface: #faf7fe;
  --lite-panel: rgb(253 250 255 / .91);
  --lite-line: rgb(91 61 124 / .19);
  --lite-ink: #2b203d;
  --lite-muted: #655774;
  --lite-accent: #703a9b;
  --lite-soft: #efe4f8;
  --lite-glow: rgb(137 76 185 / .15);
  --lite-shadow: 0 12px 36px rgb(38 19 56 / .10);
}
html[data-theme="dark"]:is([data-lite-mobile-page], [data-auth-document]) {
  --lite-surface: #211831;
  --lite-panel: rgb(34 25 51 / .94);
  --lite-line: rgb(205 172 242 / .23);
  --lite-ink: #f8f1ff;
  --lite-muted: #c6b5d9;
  --lite-accent: #ddacf9;
  --lite-soft: #36244b;
  --lite-glow: rgb(209 138 255 / .13);
  --lite-shadow: 0 12px 36px rgb(9 4 19 / .25);
}

@media (max-width: 600px) {
  html[data-lite-mobile-page] body #portal-controls #theme-toggle,
  html[data-auth-document] body #portal-controls #theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-basis: 44px;
    background: var(--lite-soft);
    color: var(--lite-accent);
    border: 1px solid var(--lite-line);
    border-radius: 12px;
    box-shadow: none;
  }
}

html[data-auth-document] .auth-card,
html[data-auth-document] .auth-pending-panel {
  color: var(--lite-ink);
  border-color: var(--lite-line);
  background: linear-gradient(145deg, var(--lite-glow), transparent 45%), var(--lite-panel);
  box-shadow: var(--lite-shadow);
}
html[data-auth-document] :is(.auth-form input, .auth-tabs) {
  background: var(--lite-surface);
  border: 1px solid var(--lite-line);
}
html[data-auth-document] .auth-tabs { padding: 4px; border-radius: 12px; }
html[data-auth-document] .auth-tabs button { border-color: transparent; }
html[data-auth-document] .auth-tabs button.is-active {
  background: var(--lite-soft);
  color: var(--lite-accent);
  border-color: var(--lite-line);
  font-weight: 650;
}
html[data-auth-document] .auth-primary { background: linear-gradient(105deg, #6d39a1, #993d83); }
html[data-auth-document] :is(.auth-recovery-dialog, .auth-recovery-head) {
  color: var(--lite-ink);
  background: var(--lite-surface);
}

html[data-lite-mobile-page="home"] .portal-settings-dialog {
  background: var(--lite-surface);
  color: var(--ps-text);
}
html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-content {
  background: linear-gradient(150deg, var(--lite-glow), transparent 220px), var(--lite-surface);
}
html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-pane-note { color: var(--lite-muted); }
html[data-lite-mobile-page="home"] :is(.lite-settings-card, .settings-device-row) {
  background: var(--lite-panel);
  border-color: var(--lite-line);
  border-radius: 14px;
}
html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-qq-console fieldset { min-width: 0; }
html[data-lite-mobile-page="home"] .lite-audit-card { padding: 12px; }
html[data-lite-mobile-page="home"] .lite-audit-summary { min-width: 0; overflow-wrap: anywhere; }

html[data-lite-mobile-page="bookmarks"] .bookmark-app .topbar,
html[data-lite-mobile-page="reader"]:not(.pip-mode) .toolbar,
html[data-lite-mobile-page="lingxi"] .app .topbar {
  background: var(--lite-panel);
  border-color: var(--lite-line);
}
html[data-lite-mobile-page="bookmarks"] .card {
  background: var(--lite-panel);
  border-color: var(--lite-line);
}
html[data-lite-mobile-page="bookmarks"] .card:hover { border-color: var(--primary-border); }
html[data-lite-mobile-page="reader"]:not(.pip-mode) .reader-empty {
  color: var(--lite-muted);
  padding-inline: 16px;
}
html[data-lite-mobile-page="lingxi"] .composer {
  background: var(--lite-panel);
  border-color: var(--lite-line);
  box-shadow: var(--lite-shadow);
}
html[data-lite-mobile-page="lingxi"] .composer:focus-within { border-color: var(--lite-accent); }
html[data-lite-mobile-page="lingxi"] .welcome .sug {
  background: var(--lite-panel);
  border-color: var(--lite-line);
}
html[data-lite-mobile-page="lingxi"] .settings-workspace {
  --settings-bg: var(--lite-surface);
  --settings-panel: var(--lite-panel);
  --settings-soft: var(--lite-soft);
  --settings-line: var(--lite-line);
  --settings-ink: var(--lite-ink);
  --settings-muted: var(--lite-muted);
  background: var(--settings-bg);
}

html[data-lite-mobile-page="monitor"] .service-status-root {
  --monitor-surface: var(--lite-panel);
  --monitor-border: var(--lite-line);
}
html[data-lite-mobile-page="monitor"] .service-status-toolbar { flex-wrap: wrap; }
html[data-lite-mobile-page="excel"] {
  --panel-bg: var(--lite-panel);
  --field-bg: var(--lite-surface);
  --line: var(--lite-line);
  --shadow: var(--lite-shadow);
}
html[data-lite-mobile-page="excel"] :is(.topbar, .tabs, .preview-panel, .settings-panel) {
  border-radius: 14px;
}
html[data-lite-mobile-page="excel"] #excelUsageCounts strong { color: var(--lite-accent); font-variant-numeric: tabular-nums; }

html[data-lite-mobile-page="archive"] .qq-archives {
  --archive-glass: var(--lite-panel);
  --archive-surface: var(--lite-surface);
  --archive-line: var(--lite-line);
  --archive-sent: var(--lite-soft);
  --archive-reply: color-mix(in srgb, var(--lite-surface) 87%, var(--lite-muted));
}
html[data-lite-mobile-page="archive"] .archive-messages {
  background: radial-gradient(ellipse at top right, var(--lite-glow), transparent 72%), var(--lite-surface);
}
html[data-lite-mobile-page="archive"] .archive-round { gap: 10px; margin-bottom: 18px; }
html[data-lite-mobile-page="archive"] .archive-message { margin-top: 4px; }

html[data-lite-mobile-page] .cs-dialog {
  --cs-surface: var(--lite-surface);
  --cs-card: var(--lite-panel);
  --cs-line: var(--lite-line);
  --cs-accent-soft: var(--lite-soft);
}

@media (min-width: 601px) {
  html[data-lite-mobile-page="home"] #topbar {
    border-radius: 16px;
    background: var(--lite-panel);
    border-color: var(--lite-line);
    box-shadow: var(--lite-shadow);
  }
  html[data-lite-mobile-page="home"] .main { padding-top: clamp(8px, 1.5vh, 18px); }
  html[data-lite-mobile-page="home"] .portal-card {
    min-height: 154px;
    gap: 10px;
    padding: 16px 18px;
    border-color: var(--lite-line);
    border-radius: 16px;
    background: linear-gradient(140deg, var(--lite-glow), transparent 50%), var(--lite-panel);
    box-shadow: var(--lite-shadow);
  }
  html[data-lite-mobile-page="home"] .card-icon {
    margin-bottom: 10px;
    border-color: var(--lite-line);
    background: var(--lite-soft);
    color: var(--lite-accent);
  }
  html[data-lite-mobile-page="home"] .card-desc { color: var(--lite-muted); }
  html[data-lite-mobile-page="home"] .card-action { color: var(--lite-accent); font-size: 13px; }

  html[data-auth-document] .auth-surface {
    min-height: 100dvh;
    padding: 32px 24px;
  }
  html[data-auth-document] .auth-sheet { width: min(480px, 100%); }
  html[data-auth-document] .auth-brand { padding: 8px 4px; }
  html[data-auth-document] .auth-card { border-radius: 22px; padding: 24px; }
  html[data-auth-document] .auth-form input { min-height: 46px; }
  html[data-auth-document] .auth-primary { min-height: 44px; }

  html[data-lite-mobile-page="excel"]:not([data-frame-embedded="true"]) .container {
    min-height: 100dvh;
    height: auto;
  }
  html[data-lite-mobile-page="excel"]:not([data-frame-embedded="true"]) body { overflow: auto; }
}

@media (max-width: 600px) {
  html[data-auth-document] .auth-surface {
    min-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
      max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    align-items: flex-start;
  }
  html[data-auth-document] .auth-sheet {
    min-width: 0;
    margin-block: auto;
    gap: 12px;
  }
  html[data-auth-document] .auth-brand {
    min-height: 48px;
    padding-inline-end: 56px;
  }
  html[data-auth-document] .auth-card {
    padding: 16px;
    border-radius: 20px;
  }
  html[data-auth-document] :is(.auth-form, .auth-form-step) { min-width: 0; gap: 8px; }
  html[data-auth-document] :is(.auth-form input, .auth-recovery-dialog .auth-form input) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 48px;
    font-size: 16px;
  }
  html[data-auth-document] .auth-password-field input { padding-inline-end: 50px; }
  html[data-auth-document] :is(.auth-tabs button, .auth-primary, .auth-secondary, .auth-link) { min-height: 44px; }
  html[data-auth-document] .auth-secondary:not([hidden]),
  html[data-auth-document] .auth-activation summary {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  html[data-auth-document] .auth-activation summary { gap: 8px; }
  html[data-auth-document] .auth-activation summary::before { content: "＋"; }
  html[data-auth-document] .auth-activation[open] summary::before { content: "−"; }
  html[data-auth-document] .auth-activation summary::-webkit-details-marker { display: none; }
  html[data-auth-document] .auth-label-row { align-items: center; }
  html[data-auth-document] :is(.auth-label-row .auth-recover, .auth-password-toggle) { min-height: 44px; }
  html[data-auth-document] .auth-password-toggle { width: 44px; }
  html[data-auth-document] body div#portal-controls {
    inset: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) auto auto !important;
  }
  html[data-auth-document] .auth-recovery-dialog {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    margin: 0;
    padding: 0;
    border-radius: 20px 20px 0 0;
    overscroll-behavior: contain;
  }
  html[data-auth-document] .auth-recovery-head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--line);
    background: var(--lite-surface);
  }
  html[data-auth-document] .auth-recovery-close { width: 44px; height: 44px; }
  html[data-auth-document] .auth-recovery-body {
    padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
}

@media (max-width: 600px) {
  html[data-lite-mobile-page] {
    --mobile-bg: var(--bg, #eef2fb);
    --mobile-surface: var(--lite-panel);
    --mobile-ink: var(--text, #29243c);
    --mobile-muted: var(--muted, var(--text-2, #706980));
    --mobile-accent: var(--primary, #76479d);
    --mobile-line: var(--lite-line);
    --mobile-soft: var(--primary-soft, color-mix(in srgb, var(--mobile-accent) 10%, var(--mobile-surface)));
    --mobile-edge: color-mix(in srgb, var(--mobile-accent) 24%, var(--mobile-line));
    --mobile-bar: calc(54px + env(safe-area-inset-top));
    --mobile-bottom-bar: calc(60px + env(safe-area-inset-bottom));
    --mobile-app-height: calc(100dvh - var(--mobile-bar));
  }
  html[data-lite-mobile-page][data-theme="dark"] {
    --mobile-bg: var(--bg, #0f0a1c);
    --mobile-ink: var(--text, #f4eefb);
    --mobile-muted: var(--muted, var(--text-2, #b6acc7));
    --mobile-accent: var(--primary, var(--accent2, #c084fc));
  }
  html[data-lite-mobile-page="excel"] {
    --mobile-accent: var(--blue);
    --mobile-surface: var(--panel-bg);
  }
  html[data-lite-mobile-page="archive"] .qq-archives {
    --mobile-surface: var(--ps-raised);
    --mobile-ink: var(--ps-text);
    --mobile-muted: var(--ps-muted);
    --mobile-accent: var(--ps-accent);
    --mobile-line: var(--ps-line);
    --mobile-soft: var(--ps-tint);
  }
  html[data-lite-mobile-page]:not([data-lite-mobile-page="home"], [data-frame-embedded="true"], .pip-mode) body {
    padding-top: var(--mobile-bar);
    box-sizing: border-box;
  }
  html[data-frame-embedded="true"], html.pip-mode { --mobile-app-height: 100dvh; }
  html[data-lite-mobile-page]:not([data-lite-mobile-page="home"], [data-frame-embedded="true"], .pip-mode) body #portal-controls {
    position: fixed !important;
    inset: 0 0 auto !important;
    z-index: 28;
    width: 100%;
    height: var(--mobile-bar);
    padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    background: color-mix(in srgb, var(--mobile-surface) 94%, transparent);
    color: var(--mobile-ink);
    border: 0;
    border-bottom: 1px solid var(--mobile-line);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: blur(16px);
  }
  html[data-lite-mobile-page] body #portal-controls #theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--mobile-line);
    border-radius: 13px;
    background: var(--mobile-soft);
    color: var(--mobile-accent);
    box-shadow: none;
    transform: none;
    animation: none;
  }
  .lite-mobile-title {
    display: block;
    grid-column: 2;
    grid-row: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 650;
    margin: 0;
  }
  html[data-lite-mobile-page]:not([data-frame-embedded="true"], .pip-mode) #portal-controls .home-link {
    display: none !important;
  }
  html[data-lite-mobile-page]:not([data-frame-embedded="true"], .pip-mode) .lite-mobile-back-link {
    display: grid;
    grid-area: 1 / 1;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    color: var(--mobile-accent);
  }
  .lite-mobile-back-link::before {
    content: "";
    width: 9px;
    height: 9px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateX(2px) rotate(45deg);
  }
  .lite-mobile-back-link:active { background: var(--mobile-soft); }
  html[data-lite-mobile-page] #portal-controls:has(.lite-mobile-title) #theme-toggle {
    grid-area: 1 / 3;
  }
  html[data-lite-mobile-page] .lite-mobile-action {
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
    background: var(--mobile-soft);
    color: var(--mobile-accent);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
  }
  html[data-lite-mobile-page]:not(.pip-mode) :is(
    :where(#modes).lite-mobile-bottom-nav,
    .seg.lite-mobile-bottom-nav
  ) {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    flex: 0 0 auto;
    align-items: stretch;
    gap: 6px;
    min-height: var(--mobile-bottom-bar);
    width: 100%;
    margin: 0;
    padding: 5px max(10px, env(safe-area-inset-right))
      calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    box-sizing: border-box;
    border: 0;
    border-top: 1px solid var(--mobile-line);
    border-radius: 0;
    background: var(--mobile-surface);
    box-shadow: 0 -3px 12px rgb(23 15 37 / .04);
  }
  html[data-lite-mobile-page]:not(.pip-mode) .lite-mobile-bottom-nav > :is(a, button) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: auto;
    min-width: 0;
    min-height: 44px;
    padding: 5px 3px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--mobile-muted);
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
  }
  html[data-lite-mobile-page]:not(.pip-mode) .lite-mobile-bottom-nav > :is(.active, .is-active) {
    border-color: color-mix(in srgb, var(--mobile-accent) 38%, var(--mobile-line));
    background: var(--mobile-soft);
    color: var(--mobile-accent);
    font-weight: 650;
  }
  html[data-lite-mobile-page]:not(.pip-mode) .lite-mobile-bottom-nav > :is(a, button):focus-visible {
    outline: 2px solid var(--mobile-accent);
    outline-offset: -3px;
  }

  /* 手机功能目录 */
  html[data-lite-mobile-page="home"] #app {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    padding: 0;
  }
  html[data-lite-mobile-page="home"] body #app > #topbar {
    gap: 8px;
    padding: calc(6px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left));
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }
  html[data-lite-mobile-page="home"] .brand { gap: 6px; }
  html[data-lite-mobile-page="home"] .brand-title {
    display: inline;
    font-size: 15px;
  }
  html[data-lite-mobile-page="home"] #portalLogo {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  html[data-lite-mobile-page="home"] body .portal-session > #portal-controls {
    position: static !important;
    display: block;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  html[data-lite-mobile-page="home"] .portal-session > #portalAvatar.portal-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex-basis: 32px;
  }
  html[data-lite-mobile-page="home"] body #app > .main {
    width: 100%;
    padding: 12px max(14px, env(safe-area-inset-right)) 16px max(14px, env(safe-area-inset-left));
  }
  html[data-lite-mobile-page="home"] .workspace-section { gap: 10px; }
  html[data-lite-mobile-page="home"] .workspace-heading {
    position: relative;
    isolation: isolate;
    display: block;
    overflow: hidden;
    padding: 12px 14px;
    border: 1px solid var(--mobile-edge);
    border-radius: 18px;
    background:
      radial-gradient(ellipse at 94% 8%, color-mix(in srgb, var(--accent2) 20%, transparent), transparent 68%),
      linear-gradient(118deg, var(--lite-panel), transparent 84%);
  }
  html[data-lite-mobile-page="home"] .workspace-heading::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -35px;
    right: -32px;
    width: 174px;
    height: 114px;
    border: 1px solid color-mix(in srgb, var(--accent2) 37%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent2) 12%, transparent),
      0 0 0 28px color-mix(in srgb, var(--accent2) 7%, transparent);
    transform: rotate(-30deg);
    pointer-events: none;
  }
  html[data-lite-mobile-page="home"] .workspace-heading::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 12px;
    right: 112px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 10px 2px var(--accent2);
    pointer-events: none;
  }
  html[data-lite-mobile-page="home"] .workspace-heading .workspace-art-title {
    font-size: clamp(22px, 6.7vw, 34px);
    letter-spacing: .025em;
  }
  html[data-lite-mobile-page="home"] .workspace-heading p { font-size: 13px; }
  html[data-lite-mobile-page="home"] :is(.workspace-identity, .workspace-count) { display: none; }
  html[data-lite-mobile-page] .lite-mobile-directory {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    box-sizing: border-box;
    align-self: start;
    gap: 0;
    margin: 0;
    border: 1px solid var(--mobile-edge);
    border-radius: 20px;
    background:
      linear-gradient(155deg, color-mix(in srgb, var(--mobile-accent) 8%, transparent), transparent 65%),
      color-mix(in srgb, var(--mobile-surface) 94%, transparent);
    box-shadow: inset 0 1px rgb(255 255 255 / .12), 0 8px 26px rgb(18 11 32 / .08);
  }
  html[data-lite-mobile-page] .lite-mobile-directory > :is(.portal-card, .lite-mobile-row):not([hidden]) {
    position: relative;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 12px;
    grid-template-rows: auto;
    gap: 3px 10px;
    align-items: center;
    align-content: center;
    min-height: 52px;
    width: 100%;
    padding: 6px 13px 6px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: var(--mobile-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    text-decoration: none;
    text-align: left;
    touch-action: manipulation;
    cursor: pointer;
    transform: none;
    transition: background-color .16s ease, transform .16s ease;
  }
  html[data-lite-mobile-page] .lite-mobile-directory > :is(.portal-card, .lite-mobile-row):not([hidden]) ~ :is(.portal-card, .lite-mobile-row):not([hidden]) {
    background-image: linear-gradient(var(--mobile-line), var(--mobile-line));
    background-position: right 14px top;
    background-size: calc(100% - 70px) 1px;
    background-repeat: no-repeat;
  }
  html[data-lite-mobile-page] .lite-mobile-directory > :is(a, button):active {
    background-color: var(--mobile-soft);
    transform: scale(.992);
  }
  html[data-lite-mobile-page] .lite-mobile-directory > :is(a, button):focus-visible {
    outline: 2px solid var(--mobile-accent);
    outline-offset: -3px;
  }
  .lite-mobile-module-menu .lite-mobile-row :is(strong, small) { display: block; }
  .lite-mobile-module-menu .lite-mobile-row small {
    margin-top: 2px;
    color: var(--lite-muted);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 400;
  }
  html[data-lite-mobile-page="home"] .lite-mobile-directory > .portal-card:not([hidden]) {
    min-height: 58px;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    backdrop-filter: none;
  }
  html[data-lite-mobile-page="home"] .portal-card > div:first-child { display: contents; }
  html[data-lite-mobile-page="home"] .portal-card .card-action { display: none; }
  html[data-lite-mobile-page="home"] .portal-card .card-title { margin: 0; font: inherit; }
  html[data-lite-mobile-page="home"] .portal-card .card-desc {
    display: -webkit-box;
    grid-column: 2;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
  }
  html[data-lite-mobile-page="home"] .portal-card .card-icon {
    grid-row: 1 / 3;
    width: 36px;
    height: 36px;
    margin: 0;
    color: var(--mobile-accent);
    border-color: var(--mobile-edge);
    border-radius: 12px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--mobile-icon-tint, var(--accent2)) 24%, transparent), var(--mobile-soft));
    box-shadow: inset 0 1px rgb(255 255 255 / .14);
  }
  html[data-lite-mobile-page="home"] :is(#bookmarksLink, #lingxiLink) { --mobile-icon-tint: var(--accent); }
  html[data-lite-mobile-page="home"] .portal-card::after { grid-row: 1 / 3; }
  .lite-mobile-directory .lite-mobile-row-icon,
  .lite-mobile-directory .lite-mobile-row:is(.lite-mobile-config-row, .lite-mobile-history-row)::before {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--mobile-accent);
    background: var(--mobile-soft);
    border: 1px solid var(--mobile-line);
    border-radius: 11px;
    font-size: 18px;
  }
  .lite-mobile-row-icon svg { width: 19px; height: 19px; }
  .lite-mobile-config-row::before { content: "⚙"; }
  .lite-mobile-history-row::before { content: "◷"; }
  .lite-mobile-directory > :is(a, button)::after {
    content: "";
    grid-column: 3;
    justify-self: center;
    width: 7px;
    height: 7px;
    border-top: 1.5px solid var(--mobile-accent);
    border-right: 1.5px solid var(--mobile-accent);
    transform: rotate(45deg);
  }
  .lite-mobile-home-nav {
    display: grid;
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 10;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: min(360px, calc(100% - 32px));
    margin: 0 auto calc(8px + env(safe-area-inset-bottom));
    padding: 4px;
    background: color-mix(in srgb, var(--mobile-surface) 90%, transparent);
    border: 1px solid var(--mobile-edge);
    border-radius: 18px;
    backdrop-filter: blur(18px);
    box-shadow: inset 0 1px rgb(255 255 255 / .14), 0 8px 24px rgb(3 15 38 / .18);
  }
  .lite-mobile-home-nav > button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    margin: 0;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--mobile-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
  }
  .lite-mobile-home-current::before {
    content: "";
    width: 14px;
    height: 14px;
    background:
      radial-gradient(circle, currentColor 2px, transparent 2.4px) 0 0 / 7px 7px;
  }
  .lite-mobile-home-nav > [aria-current] {
    background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 13%, var(--mobile-soft)), var(--mobile-soft));
    color: var(--mobile-accent);
    box-shadow: inset 0 -2px color-mix(in srgb, var(--mobile-accent) 70%, transparent);
  }
  .lite-mobile-home-nav > button:active { transform: scale(.98); }

  html[data-lite-mobile-page="home"] .portal-settings-dialog {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    background: var(--lite-surface);
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-layout {
    grid-template-rows: 56px minmax(0, 1fr);
    padding-top: env(safe-area-inset-top);
  }
  html[data-lite-mobile-page="home"] .lite-mobile-settings-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
    border-bottom: 1px solid var(--ps-line);
    background: color-mix(in srgb, var(--ps-solid) 86%, transparent);
    color: var(--ps-text);
    text-align: center;
    font-size: 16px;
    font-weight: 650;
  }
  .lite-mobile-settings-header > span {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .portal-settings-close {
    top: calc(6px + env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-sidebar {
    grid-row: 2;
    overflow: auto;
    padding: 12px max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: transparent;
    border: 0;
  }
  html[data-lite-mobile-page="home"] .settings-sidebar .settings-brand { display: none; }
  html[data-lite-mobile-page="home"] .settings-sidebar #portalLogout {
    min-height: 44px;
    margin: 14px 0 0;
    border-color: var(--mobile-line);
    background: var(--mobile-surface);
    color: var(--mobile-ink);
  }
  html[data-lite-mobile-page="home"] .settings-nav-groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding: 0;
    overflow: visible;
  }
  html[data-lite-mobile-page="home"] .settings-nav-group:not([hidden]) {
    display: grid;
    padding: 4px 8px;
    border: 1px solid var(--ps-line);
    border-radius: 17px;
    background: linear-gradient(155deg, var(--ps-tint), transparent 76%), color-mix(in srgb, var(--ps-solid) 76%, transparent);
  }
  html[data-lite-mobile-page="home"] .settings-nav-heading {
    display: block;
    padding: 7px 6px 4px;
    color: var(--ps-muted);
    font-size: 12px;
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-nav-button {
    min-height: 56px;
    padding: 7px 9px 7px 5px;
    gap: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ps-text);
  }
  html[data-lite-mobile-page="home"] .settings-nav-button:not([hidden]) ~ .settings-nav-button:not([hidden]) {
    border-top: 1px solid var(--ps-line);
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-nav-button.active {
    box-shadow: none;
    color: var(--ps-text);
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .settings-nav-button:active { background: var(--ps-tint); }
  html[data-lite-mobile-page="home"] .settings-nav-button::after,
  .lite-mobile-settings-back::before {
    content: "";
    width: 7px;
    height: 7px;
    border-top: 1.5px solid var(--ps-accent);
    border-right: 1.5px solid var(--ps-accent);
    transform: rotate(45deg);
  }
  html[data-lite-mobile-page="home"] .settings-nav-button::after { margin-left: auto; flex-shrink: 0; }
  html[data-lite-mobile-page="home"] .settings-nav-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
    background: var(--ps-tint);
    color: var(--ps-accent);
  }
  html[data-lite-mobile-page="home"] .settings-nav-icon svg { width: 17px; height: 17px; }
  html[data-lite-mobile-page="home"] .settings-nav-copy strong { font-size: 15px; }
  html[data-lite-mobile-page="home"] .settings-nav-copy small { display: block; font-size: 12px; }
  html[data-lite-mobile-page="home"] .settings-content {
    grid-row: 2;
    padding: 14px max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    scrollbar-gutter: auto;
  }
  html[data-lite-mobile-page="home"] .settings-content .settings-pane-title { display: none; }
  html[data-lite-mobile-page="home"] .settings-content .settings-pane-note { font-size: 13px; }
  html[data-lite-mobile-page="home"] .portal-settings-dialog:not([data-mobile-pane]) .settings-content,
  html[data-lite-mobile-page="home"] .portal-settings-dialog:not([data-mobile-pane]) .lite-mobile-settings-back,
  html[data-lite-mobile-page="home"] .portal-settings-dialog[data-mobile-pane] .settings-sidebar { display: none; }
  .lite-mobile-settings-back {
    display: grid;
    place-items: center;
    grid-area: 1 / 1;
    width: 44px;
    height: 44px;
    border: 1px solid var(--ps-line);
    border-radius: 13px;
    background: var(--ps-tint);
    cursor: pointer;
  }
  .lite-mobile-settings-back::before { transform: translateX(2px) rotate(-135deg); }
  html[data-lite-mobile-page="home"] .workspace-quote-actions .workspace-quote-save {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .workspace-quote-settings {
    background: color-mix(in srgb, var(--ps-solid) 80%, transparent);
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog :is(input, select, textarea) { font-size: 16px; }

  /* 常用网址 */
  html[data-lite-mobile-page="bookmarks"] .bookmark-app { height: var(--mobile-app-height); }
  html[data-lite-mobile-page="bookmarks"] .bookmark-app .topbar {
    height: auto;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 6px 12px;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="bookmarks"] .topbar .search {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
  }
  html[data-lite-mobile-page="bookmarks"] .topbar :is(.sidebar-open, .cs-page-entry, #acctBtn, .search input) {
    min-height: 44px;
  }
  html[data-lite-mobile-page="bookmarks"] .topbar .search input { font-size: 16px; }
  html[data-lite-mobile-page="bookmarks"] .topbar .bookmark-account-entry { grid-column: 3 / -1; }
  html[data-lite-mobile-page="bookmarks"] .topbar .search input {
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: var(--mobile-soft);
  }
  html[data-lite-mobile-page="bookmarks"] .panel { padding: 10px 12px 12px; }
  html[data-lite-mobile-page="bookmarks"] .panel .hero { gap: 6px; margin-bottom: 6px; padding: 0; }
  html[data-lite-mobile-page="bookmarks"] .hero-copy { flex: 1; }
  html[data-lite-mobile-page="bookmarks"] .hero h1 { margin: 0; font-size: 18px; }
  html[data-lite-mobile-page="bookmarks"] .stats { margin: 0; gap: 10px; }
  html[data-lite-mobile-page="bookmarks"] .stat:not(:first-child) { padding-inline-start: 10px; }
  html[data-lite-mobile-page="bookmarks"] .group { margin-bottom: 14px; }
  html[data-lite-mobile-page="bookmarks"] .group-head { margin-bottom: 6px; padding-bottom: 5px; }
  html[data-lite-mobile-page="bookmarks"] .group .grid { grid-template-columns: minmax(0, 1fr); }
  html[data-lite-mobile-page="bookmarks"] :is(.hero-kicker, .hero-sub, .workspace-foot, #emptyAddCat) { display: none; }
  html[data-lite-mobile-page="bookmarks"] .lite-mobile-bookmark-dock {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    flex: 0 0 auto;
    padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--mobile-line);
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="bookmarks"]:not(.pip-mode) .lite-mobile-bookmark-dock .seg.lite-mobile-bottom-nav,
  .lite-mobile-bookmark-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .lite-mobile-bookmark-actions {
    padding-inline-start: 7px;
    border-inline-start: 1px solid var(--mobile-line);
  }
  html[data-lite-mobile-page="bookmarks"] .lite-mobile-bookmark-dock :is(.lite-mobile-bottom-nav button, .lite-mobile-action) {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 46px;
    padding: 4px 2px;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
  }
  .lite-mobile-bookmark-actions svg { width: 16px; height: 16px; flex: 0 0 16px; }
  html[data-lite-mobile-page="bookmarks"] .lite-mobile-bookmark-actions .lite-mobile-action:first-child {
    color: var(--mobile-surface);
    background: var(--mobile-accent);
    border-color: transparent;
  }
  html[data-lite-mobile-page="bookmarks"] .collection-toolbar { gap: 6px; margin-bottom: 6px; padding-bottom: 6px; }
  html[data-lite-mobile-page="bookmarks"] .lite-mobile-bookmark-actions .lite-mobile-action:disabled {
    opacity: .5;
    cursor: default;
  }
  html[data-lite-mobile-page="bookmarks"] .browse-options { flex: 0 1 auto; }
  html[data-lite-mobile-page="bookmarks"] .collection-toolbar :is(button, .settings-select-trigger) { min-height: 44px; }
  html[data-lite-mobile-page="bookmarks"] .seg.lite-mobile-bottom-nav button svg { width: 17px; height: 17px; }
  html[data-lite-mobile-page="bookmarks"] .grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  html[data-lite-mobile-page="bookmarks"] .card {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 5px 6px 5px 8px;
    border-radius: 11px;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="bookmarks"] .card-ico { width: 34px; height: 34px; flex-basis: 34px; margin: 0; }
  html[data-lite-mobile-page="bookmarks"] .card-ico img { width: 22px; height: 22px; }
  html[data-lite-mobile-page="bookmarks"] .card-meta { width: auto; line-height: 1.35; }
  html[data-lite-mobile-page="bookmarks"] .card-name { margin-bottom: 1px; font-size: 14px; }
  html[data-lite-mobile-page="bookmarks"] .card-host { margin-top: 0; line-height: inherit; }
  html[data-lite-mobile-page="bookmarks"] .card-tags { margin-top: 2px; }
  html[data-lite-mobile-page="bookmarks"] .card-tags .mini-tag { padding-block: 1px; line-height: inherit; }
  html[data-lite-mobile-page="bookmarks"] .card-owner { margin-top: 0; }
  html[data-lite-mobile-page="bookmarks"] .card-ops {
    position: static;
    height: auto;
    flex: 0 0 auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    background: transparent;
  }
  html[data-lite-mobile-page="bookmarks"] .card-ops button { width: 44px; height: 44px; }
  html[data-lite-mobile-page="bookmarks"] .panel.selecting .card { padding: 5px 6px 5px 32px; }
  html[data-lite-mobile-page="bookmarks"] .card-check { top: 50%; left: 6px; transform: translateY(-50%); }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) {
    align-items: end;
    padding: 0;
  }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) .dialog {
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    padding: 18px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    overscroll-behavior: contain;
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom));
    scrollbar-width: thin;
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    transform: translateY(20px);
  }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim).show .dialog { transform: none; }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) h3 { font-size: 19px; }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) .dlg-sub { margin-bottom: 14px; }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) .field { margin-bottom: 11px; }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) .field :is(input, select, .settings-select-trigger) {
    min-height: 44px;
    font-size: 16px;
  }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) .dialog-foot {
    position: sticky;
    bottom: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 8px;
    margin: 10px calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
    padding: 10px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="bookmarks"] :is(#bmScrim, #cmScrim) .dialog-foot .btn { min-height: 44px; }

  /* MD 阅读器 */
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .app { height: var(--mobile-app-height); }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .toolbar {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-rows: 44px;
    gap: 6px;
    height: auto;
    flex: 0 0 auto;
    padding: 6px 12px 8px;
    overflow: visible;
    background: var(--mobile-surface);
    box-shadow: none;
    z-index: 5;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .toolbar > .doc-title { max-width: none; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .toolbar > .spacer { display: none; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .toolbar > #saveBtn {
    grid-column: 3;
    grid-row: 1;
    min-height: 44px;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #saveBtn .label { display: inline; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .lite-mobile-reader-dock {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
    gap: 4px;
    padding: 5px max(10px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--mobile-line);
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .lite-mobile-reader-dock #modes {
    flex: 1 1 auto;
    gap: 3px;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  .lite-mobile-reader-menu {
    flex: 0 0 56px;
    margin-inline-start: auto;
  }
  .lite-mobile-reader-menu summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 4px;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
    background: var(--mobile-soft);
    color: var(--mobile-accent);
    font-size: 13px;
    font-weight: 650;
    list-style: none;
    cursor: pointer;
  }
  .lite-mobile-reader-menu summary::after {
    content: "";
    width: 5px;
    height: 5px;
    border: solid currentColor;
    border-width: 1.5px 0 0 1.5px;
    transform: translateY(1px) rotate(45deg);
  }
  .lite-mobile-reader-menu[open] summary::after { transform: translateY(-1px) rotate(225deg); }
  .lite-mobile-reader-menu summary::-webkit-details-marker { display: none; }
  .lite-mobile-reader-actions {
    position: absolute;
    inset: auto max(10px, env(safe-area-inset-right)) calc(100% + 8px) max(10px, env(safe-area-inset-left));
    z-index: 6;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    max-height: min(48dvh, 320px);
    padding: 8px;
    overflow: auto;
    border: 1px solid var(--mobile-line);
    border-radius: 18px;
    background: var(--mobile-surface);
    box-shadow: 0 10px 28px rgb(20 9 38 / .2);
  }
  html[data-lite-mobile-page="reader"] .lite-mobile-reader-actions :is(.btn, .icon-btn) {
    width: auto;
    min-height: 44px;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: var(--mobile-soft);
  }
  html[data-lite-mobile-page="reader"] .lite-mobile-reader-actions .btn .label { display: inline; }
  .lite-mobile-reader-actions #outlineBtn::after { content: "目录"; }
  .lite-mobile-reader-actions #findOpenBtn::after { content: "查找"; }
  html[data-lite-mobile-page="reader"] .lite-mobile-reader-actions .read-tools { justify-content: center; }
  html[data-lite-mobile-page="reader"] .app.file-readable:not(.is-map) .lite-mobile-reader-actions .paper-theme-select { display: inline-flex; width: auto; }
  .lite-mobile-reader-actions .paper-theme-select #themeSel {
    width: 100%;
    min-height: 44px;
    padding-inline: 10px 24px;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: var(--mobile-soft);
    color: var(--mobile-ink);
    font-size: 16px;
  }
  html[data-lite-mobile-page="reader"] .reader-empty { gap: 12px; align-content: center; justify-items: center; text-align: center; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .reader-empty > .lite-mobile-action { display: inline-flex; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #app[data-mode="split"]:not(.is-map) #workspace { flex-direction: column; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #app[data-mode="split"]:not(.is-map) #workspace > :is(#editor, #preview) {
    flex: 1 1 0;
    width: 100%;
    max-width: none;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #app[data-mode="split"] #workspace > .divider { flex: 0 0 1px; width: 100%; pointer-events: none; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #app.paper-split[data-mode="split"] #workspace::before,
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #app.paper-split[data-mode="split"] #workspace::after {
    inset: 0 0 50%;
    width: auto;
    margin: 0;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #app.paper-split[data-mode="split"] #workspace::after { inset: 50% 0 0; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #editor { font-size: 16px; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #app[data-mode="preview"] #formatBar { display: none; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .statusbar {
    justify-content: space-between;
    gap: 6px;
    padding-inline: 10px;
    font-size: 12px;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .statusbar #pageNav {
    position: static;
    transform: none;
    flex-shrink: 0;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .statusbar .stat-item {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* 服务监控 */
  html[data-lite-mobile-page="monitor"] .service-status-root { padding: 16px 16px max(20px, env(safe-area-inset-bottom)); }
  html[data-lite-mobile-page="monitor"] #serviceStatusRoot .monitor-sidebar,
  html[data-lite-mobile-page="monitor"]:not([data-lite-mobile-detail]) .monitor-content > :not(#serviceConfigDrawer),
  html[data-lite-mobile-detail] .lite-mobile-directory.lite-mobile-module-menu { display: none; }
  html[data-lite-mobile-page="monitor"]:not([data-lite-mobile-detail]) .monitor-content { display: contents; }
  html[data-lite-mobile-page="monitor"] .service-status-full .service-status-section { animation: none; }
  html[data-lite-mobile-page="monitor"] :is(.service-status-brand, .service-module-identity, .service-section-index) { display: none; }
  html[data-lite-mobile-page="monitor"] .service-status-toolbar { display: flex; width: 100%; gap: 6px; }
  html[data-lite-mobile-page="monitor"] .service-status-toolbar button { min-height: 44px; flex: 1 1 auto; justify-content: center; }
  html[data-lite-mobile-page="monitor"] #serviceSnapshot .service-status-metric-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  html[data-lite-mobile-page="monitor"] #serviceSnapshot .service-status-metric {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 8px;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="monitor"] #serviceSnapshot .service-status-metric > :last-child { grid-column: 1 / -1; }
  html[data-lite-mobile-page="monitor"] #serviceLogPanel .service-status-log {
    min-height: 200px;
    height: 48dvh;
    resize: none;
  }
  html[data-lite-mobile-page="monitor"] #serviceLogPanel[data-expanded="true"] .service-status-log { height: 74dvh; }

  /* Excel 工具 */
  html[data-lite-mobile-page="excel"] .container { min-height: 0; padding: 16px 16px max(20px, env(safe-area-inset-bottom)); }
  html[data-lite-mobile-page="excel"]:not([data-lite-mobile-detail]) .container > :not(.lite-mobile-module-menu),
  html[data-lite-mobile-page="excel"] .container > .tabs > .tab { display: none !important; }
  html[data-lite-mobile-page="excel"] .container > .topbar {
    order: 2;
    margin-top: 3px;
    box-shadow: none;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="excel"] .container > .topbar > div:first-child { display: none; }
  html[data-lite-mobile-page="excel"] #excelUsageCounts { justify-content: space-between !important; width: 100%; }
  html[data-lite-mobile-page="excel"] .tabs { display: block; border: 0; padding: 6px; border-radius: 12px; background: var(--mobile-surface); }
  html[data-lite-mobile-page="excel"] .tab-actions {
    justify-content: stretch;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="excel"] .tab-actions .upload-btn { flex: 1 1 auto; font-size: 16px; }
  html[data-lite-mobile-page="excel"] .tab-actions .history-btn { order: 1; }
  html[data-lite-mobile-page="excel"] .preview-panel { min-height: 0; padding: 12px; }
  html[data-lite-mobile-page="excel"] .preview-panel .empty-state { flex: 0 1 auto; height: auto; padding: 14px 4px; }
  html[data-lite-mobile-page="excel"] .empty-state .upload-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
    background: var(--mobile-soft);
    box-shadow: 0 0 25px color-mix(in srgb, var(--mobile-accent) 18%, transparent);
    font-size: 24px;
    opacity: 1;
  }
  html[data-lite-mobile-page="excel"] .table-scroll,
  html[data-lite-mobile-page="excel"] .merge-preview-scroll { max-height: 45dvh; }
  html[data-lite-mobile-page="excel"] #diffPanel .settings-panel { order: -1; }
  html[data-lite-mobile-page="excel"] #diffPanel .preview-panel:has(#diffFileInfo.hidden) { display: none; }
  html[data-lite-mobile-page="excel"] #splitPanel .settings-panel:has(#splitSettings.hidden),
  html[data-lite-mobile-page="excel"] #mergePanel .settings-panel:has(#mergeSettings.hidden),
  html[data-lite-mobile-page="excel"] #splitEmptyState p:last-child,
  html[data-lite-mobile-page="excel"] #mergeEmptyState p:last-child { display: none; }
  html[data-lite-mobile-page="excel"] :is(.settings-panel, .preview-panel) {
    border-color: var(--mobile-line);
    background: var(--mobile-surface);
    box-shadow: none;
  }
  html[data-lite-mobile-page="excel"] .settings-panel :is(input:not([type="checkbox"], [type="radio"]), select, button) { min-height: 44px; }
  html[data-lite-mobile-page="excel"] .settings-panel :is(input, select) { font-size: 16px; }

  /* 灵犀总结 */
  html[data-lite-mobile-page="lingxi"] .app { height: var(--mobile-app-height); }
  html[data-lite-mobile-page="lingxi"] .app .topbar {
    height: auto;
    min-height: 52px;
    padding: 4px 10px;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="lingxi"] .workspace-label { display: none; }
  html[data-lite-mobile-page="lingxi"] .topbar :is(.ib, .model-chip) { min-height: 44px; }
  html[data-lite-mobile-page="lingxi"] .topbar .ib { width: 44px; }
  html[data-lite-mobile-page="lingxi"] .stream { padding-top: 0; }
  html[data-lite-mobile-page="lingxi"] .stream-in:has(.welcome) { justify-content: start; }
  html[data-lite-mobile-page="lingxi"] .welcome { padding: 20px 0; }
  html[data-lite-mobile-page="lingxi"] .welcome :is(.w-eyebrow, .w-tips) { display: none; }
  html[data-lite-mobile-page="lingxi"] .welcome .w-title { font-size: 24px; margin-bottom: 8px; }
  html[data-lite-mobile-page="lingxi"] .welcome .sugs { grid-template-columns: minmax(0, 1fr); }
  html[data-lite-mobile-page="lingxi"] .welcome .sug {
    min-height: 54px;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="lingxi"] .welcome .sug .tx span { display: none; }
  html[data-lite-mobile-page="lingxi"] .dock {
    padding: 6px 10px max(10px, env(safe-area-inset-bottom));
    background: var(--mobile-bg);
    border-top: 1px solid var(--mobile-line);
  }
  html[data-lite-mobile-page="lingxi"] .lite-mobile-summary-tools { display: block; flex: 0 0 auto; }
  .lite-mobile-summary-tools summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    padding: 0 6px;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: var(--mobile-soft);
    color: var(--mobile-accent);
    font-size: 13px;
    font-weight: 650;
    list-style: none;
    cursor: pointer;
  }
  .lite-mobile-summary-tools summary::-webkit-details-marker { display: none; }
  .lite-mobile-summary-tools summary::after {
    content: "";
    width: 5px;
    height: 5px;
    border: solid currentColor;
    border-width: 1.5px 0 0 1.5px;
    transform: translateY(1px) rotate(45deg);
  }
  .lite-mobile-summary-tools[open] summary::after { transform: translateY(-1px) rotate(225deg); }
  html[data-lite-mobile-page="lingxi"] .dock:has(.lite-mobile-summary-tools[open]) .jump { visibility: hidden; }
  html[data-lite-mobile-page="lingxi"] .lite-mobile-summary-tools .summary-toolbar {
    position: absolute;
    inset: auto 10px calc(100% + 8px) 10px;
    z-index: 2;
    display: grid;
    gap: 4px;
    max-height: 48dvh;
    margin: 0;
    padding: 6px;
    overflow: auto;
    border: 1px solid var(--mobile-line);
    border-radius: 16px;
    background: var(--mobile-surface);
    box-shadow: 0 8px 24px rgb(23 15 37 / .18);
  }
  html[data-lite-mobile-page="lingxi"] .lite-mobile-summary-tools .summary-caption { display: none; }
  html[data-lite-mobile-page="lingxi"] .lite-mobile-summary-tools .summary-action {
    justify-content: flex-start;
    gap: 9px;
    min-height: 44px;
    padding: 0 12px;
  }
  html[data-lite-mobile-page="lingxi"] .composer { position: relative; background: var(--mobile-surface); }
  html[data-lite-mobile-page="lingxi"] .cm-ta { min-height: 48px; font-size: 16px; }
  html[data-lite-mobile-page="lingxi"] .cm-bar {
    display: grid;
    grid-template-columns: minmax(44px, 1fr) minmax(48px, auto) 44px minmax(44px, 1fr) 44px 44px;
    gap: 2px;
    padding: 4px 6px 6px;
  }
  html[data-lite-mobile-page="lingxi"] .cm-bar > .sp { display: none; }
  html[data-lite-mobile-page="lingxi"] .cm-bar .cm-chip {
    position: relative;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 44px;
    padding-inline: 2px;
  }
  html[data-lite-mobile-page="lingxi"] .cm-chip .tx { overflow: hidden; text-overflow: ellipsis; }
  @media (max-width: 360px) {
    html[data-lite-mobile-page="lingxi"] .cm-bar .cm-chip { gap: 2px; padding-inline: 1px; font-size: 12px; }
    html[data-lite-mobile-page="lingxi"] .cm-chip svg { flex: 0 0 11px; width: 11px; }
  }
  html[data-lite-mobile-page="lingxi"] .cm-chip .bdg {
    position: absolute;
    inset: 0 0 auto auto;
    font-size: 10px;
  }
  html[data-lite-mobile-page="lingxi"] .cm-bar :is(.ring-btn, .send) { width: 44px; height: 44px; }
  html[data-lite-mobile-page="lingxi"] .settings-workspace {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    transform: none;
    animation-name: fadeIn;
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(54px + env(safe-area-inset-top)) minmax(0, 1fr);
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace :is(.settings-sidebar, .settings-content) {
    grid-row: 2;
    overflow: auto;
    padding: 12px max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    border: 0;
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-brand {
    position: absolute;
    inset: env(safe-area-inset-top) 54px auto;
    height: 54px;
    align-items: center;
    padding: 0;
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-brand h2 { font-size: 16px; }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-close {
    top: calc(5px + env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-nav {
    overflow: visible;
    padding: 5px;
    border: 1px solid var(--lite-line);
    border-radius: 16px;
    background: var(--lite-panel);
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .set-tab {
    justify-content: flex-start;
    min-height: 52px;
    height: auto;
    gap: 10px;
    padding: 5px 8px;
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .set-tab::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-inline-start: auto;
    border: solid var(--lite-accent);
    border-width: 1.5px 1.5px 0 0;
    transform: rotate(45deg);
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-nav-copy {
    display: flex;
    gap: 2px;
    line-height: 1.35;
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-sidebar-foot {
    margin-top: 12px;
    padding: 0;
  }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-sidebar-foot button { min-height: 44px; }
  html[data-lite-mobile-page="lingxi"] .settings-workspace .settings-save-note { font-size: 13px; }
  html[data-lite-mobile-page="lingxi"] .settings-workspace:not([data-mobile-pane]) .settings-content,
  html[data-lite-mobile-page="lingxi"] .settings-workspace[data-mobile-pane] .settings-sidebar { display: none; }
  html[data-lite-mobile-page="lingxi"] .settings-workspace[data-mobile-pane] .lingxi-settings-back {
    display: block;
    align-self: center;
    justify-self: start;
    margin: env(safe-area-inset-top) 0 0 max(12px, env(safe-area-inset-left));
    min-height: 44px;
    padding-inline: 12px;
    border: 1px solid var(--lite-line);
    border-radius: 11px;
    background: var(--lite-soft);
    color: var(--lite-accent);
    font: inherit;
    cursor: pointer;
  }

  /* QQ 归档 */
  html[data-lite-mobile-page="archive"] .qq-archives { padding: 0; }
  html[data-lite-mobile-page="archive"]:not([data-frame-embedded="true"]) .qq-archives { padding-top: var(--mobile-bar); }
  html[data-lite-mobile-page="archive"] .archive-shell {
    width: 100%;
    height: var(--mobile-app-height);
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--mobile-bg);
  }
  html[data-lite-mobile-page="archive"][data-frame-embedded="true"] .archive-shell { height: 100dvh; }
  html[data-lite-mobile-page="archive"] .archive-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    gap: 0;
  }
  html[data-lite-mobile-page="archive"] .archive-heading {
    min-height: 52px;
    padding: 4px 12px;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="archive"][data-frame-embedded="true"] .archive-heading { padding-right: 54px; }
  html[data-lite-mobile-page="archive"]:not([data-frame-embedded="true"]) .archive-heading h1 { display: none; }
  html[data-lite-mobile-page="archive"]:not([data-frame-embedded="true"]) .archive-heading { justify-content: flex-end; }
  html[data-lite-mobile-page="archive"] .archive-layout:not([data-mobile-view]) .archive-detail,
  html[data-lite-mobile-page="archive"] .archive-layout[data-mobile-view] .archive-sidebar { display: none; }
  html[data-lite-mobile-page="archive"] .archive-shell:has(.archive-layout[data-mobile-view]:not([hidden])) {
    grid-template-rows: minmax(0, 1fr);
  }
  html[data-lite-mobile-page="archive"] .archive-shell:has(.archive-layout[data-mobile-view]:not([hidden])) > .archive-heading { display: none; }
  html[data-lite-mobile-page="archive"] :is(.archive-sidebar, .archive-detail) { border: 0; border-radius: 0; }
  html[data-lite-mobile-page="archive"] .archive-list { padding: 4px 12px 12px; }
  html[data-lite-mobile-page="archive"] .archive-item {
    position: relative;
    gap: 2px;
    min-height: 56px;
    padding: 6px 36px 6px 10px;
    line-height: 1.35;
    border-color: var(--mobile-line);
    border-radius: 14px;
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="archive"] .archive-item::after {
    content: "";
    position: absolute;
    inset: calc(50% - 4px) 16px auto auto;
    width: 7px;
    height: 7px;
    border: solid var(--mobile-accent);
    border-width: 1.5px 1.5px 0 0;
    transform: rotate(45deg);
  }
  html[data-lite-mobile-page="archive"] .archive-detail-heading { gap: 8px; background: var(--mobile-surface); }
  html[data-lite-mobile-page="archive"][data-frame-embedded="true"] .archive-detail-heading { padding-inline-end: 54px; }
  html[data-lite-mobile-page="archive"] .archive-detail-heading > div { flex: 1; min-width: 0; }
  html[data-lite-mobile-page="archive"] .archive-detail > .archive-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 6px max(10px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--mobile-line);
    background: var(--mobile-surface);
  }
  html[data-lite-mobile-page="archive"] .archive-detail > .archive-actions:not(:has(.archive-button:not([hidden]))) { display: none; }
  html[data-lite-mobile-page="archive"] .archive-detail > .archive-actions .archive-button { flex: 1 1 auto; padding-inline: 5px; }
  html[data-lite-mobile-page="archive"] .archive-process-toggle { background: var(--mobile-soft); color: var(--mobile-accent); }
  html[data-lite-mobile-page="archive"] .archive-button { min-height: 44px; font-size: 13px; }
  .lite-mobile-archive-back {
    display: block;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: var(--mobile-soft);
    color: var(--mobile-accent);
    font: inherit;
    white-space: nowrap;
  }
  html[data-lite-mobile-page="archive"] .archive-messages { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  html[data-lite-mobile-page="archive"] .archive-message { padding: 9px 12px; font-size: 14px; line-height: 1.55; }

  /* 轻量版子页面和弹窗共用全宽表单及安全区域。 */
  html[data-lite-mobile-page="home"] .portal-settings-dialog :is(
    .settings-device-row, .background-mode-grid
  ) {
    grid-template-columns: minmax(0, 1fr);
  }
  html[data-lite-mobile-page="home"] .portal-settings-dialog :is(
    .notification-action, .settings-device-toolbar button, .settings-device-row button, .lite-settings-actions button
  ) { min-height: 44px; }
  html[data-lite-mobile-page="home"] .portal-settings-dialog .lite-password-form { padding: 14px; }
  html[data-lite-mobile-page="home"] .lite-password-form .lite-settings-actions button { width: 100%; }
  html[data-lite-mobile-page="home"] .lite-audit-toolbar > :is(:first-child, .notification-field) { grid-column: 1 / -1; }
  html[data-lite-mobile-page="home"] .lite-audit-list { padding-inline: 0; }
  html[data-lite-mobile-page="home"] .lite-audit-card { min-height: 0; }
  html[data-lite-mobile-page="home"] .lite-audit-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    text-align: center;
  }
  html[data-lite-mobile-page="home"] .lite-audit-footer > label {
    grid-column: span 2;
    justify-self: end;
  }
  html[data-lite-mobile-page="home"] .portal-qq-archive-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
  }
  html[data-lite-mobile-page="home"] .portal-qq-archive-close {
    top: calc(4px + env(safe-area-inset-top));
    right: max(6px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
  }
  html[data-lite-mobile-page="home"] .avatar-crop-dialog {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
    overflow: auto;
  }
  html[data-lite-mobile-page="home"] .avatar-crop-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  html[data-lite-mobile-page="home"] :is(.avatar-crop-close, .avatar-crop-actions button) { min-height: 44px; }

  html[data-lite-mobile-page] .cs-overlay {
    align-items: flex-end;
    padding: 0;
  }
  html[data-lite-mobile-page] .cs-dialog {
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 10px);
    border-radius: 20px 20px 0 0;
  }
  html[data-lite-mobile-page] .cs-head {
    padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  }
  html[data-lite-mobile-page] .cs-title { font-size: 16px; }
  html[data-lite-mobile-page] .cs-close { width: 44px; height: 44px; }
  html[data-lite-mobile-page] .cs-tabs {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    margin-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  }
  html[data-lite-mobile-page] .cs-tab {
    padding: 4px;
    white-space: normal;
  }
  html[data-lite-mobile-page] .cs-body {
    padding: 12px max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  html[data-lite-mobile-page] :is(.cs-publish-layout, .cs-form-grid) { grid-template-columns: minmax(0, 1fr); }
  html[data-lite-mobile-page] :is(.cs-tab, .cs-btn, .cs-input) { min-height: 44px; }
  html[data-lite-mobile-page] .cs-input { font-size: 16px; }
  html[data-lite-mobile-page] .cs-section { padding: 12px; }
  html[data-lite-mobile-page] .cs-list-row { align-items: stretch; flex-direction: column; }
  html[data-lite-mobile-page] .cs-list-row > .cs-item-ops { justify-content: flex-start; }

  html[data-lite-mobile-page="monitor"] .service-drawer-header {
    padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  }
  html[data-lite-mobile-page="monitor"] .service-drawer-header h2 { margin-top: 3px; font-size: 18px; }
  html[data-lite-mobile-page="monitor"] .service-drawer-close { flex: 0 0 44px; min-height: 44px; }
  html[data-lite-mobile-page="monitor"] .service-drawer-body {
    padding: 14px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  html[data-lite-mobile-page="monitor"] .service-status-form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html[data-lite-mobile-page="monitor"] .service-drawer-body :is(input:not([type="checkbox"]), button) { min-height: 44px; }
  html[data-lite-mobile-page="monitor"] .service-drawer-body input:not([type="checkbox"]) { font-size: 16px; }
  html[data-lite-mobile-page="monitor"] .service-drawer-body .service-status-actions button { width: 100%; }

  html[data-lite-mobile-page="excel"] :is(#historyOverlay, #resultOverlay) {
    align-items: flex-end;
    padding: 0;
  }
  html[data-lite-mobile-page="excel"] :is(.history-dialog, .result-dialog, .result-dialog.previewing) {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    padding: 12px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-radius: 20px 20px 0 0;
  }
  html[data-lite-mobile-page="excel"] .result-dialog.previewing {
    height: calc(100dvh - env(safe-area-inset-top) - 12px);
  }
  html[data-lite-mobile-page="excel"] :is(.history-row, .result-file) {
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }
  html[data-lite-mobile-page="excel"] :is(.history-main, .result-file-info) { flex: 1 0 100%; }
  html[data-lite-mobile-page="excel"] :is(.history-dialog, .modal-dialog) .btn { min-height: 44px; }
  html[data-lite-mobile-page="excel"] .confirm-dialog { max-height: calc(100dvh - 40px); overflow: auto; }

  html[data-lite-mobile-page="reader"]:not(.pip-mode) :is(#iconModal, #backupModal, #expModal, #dlgModal) > div {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
    overflow: auto;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) :is(#backupModal, #expModal, #dlgModal, #lookModal) :is(.btn, .apx-nav-item) {
    min-height: 44px;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) .bak-row { flex-wrap: wrap; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal.overlay {
    place-items: end stretch;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal.overlay > .apx-modal {
    width: 100%;
    height: min(720px, calc(100dvh - env(safe-area-inset-top) - 12px));
    border-radius: 20px 20px 0 0;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal .apx-rail {
    grid-template-columns: minmax(0, 1fr) auto 44px;
    padding: 8px 10px;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal .apx-close {
    top: 8px;
    right: 10px;
    width: 44px;
    height: 44px;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal .apx-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal .apx-nav-ind { display: none; }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal .apx-nav-item {
    justify-content: center;
    gap: 4px;
    padding-inline: 3px;
  }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal .apx-nav-item.on { background: var(--primary-soft); }
  html[data-lite-mobile-page="reader"]:not(.pip-mode) #lookModal.overlay .apx-body {
    padding: 16px max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  html[data-lite-mobile-page="home"] .app-dialog,
  html[data-lite-mobile-page="archive"] .archive-dialog {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
  }
  html[data-lite-mobile-page] :is(.app-dialog, .archive-dialog) button { min-height: 44px; }

  @media (prefers-reduced-motion: no-preference) {
    html[data-lite-mobile-page="home"] .workspace-heading::after { animation: lite-quote-glow 4s ease-in-out infinite alternate; }
    .lite-mobile-module-menu,
    html[data-lite-mobile-page="home"] .workspace-section,
    html[data-lite-mobile-page="monitor"][data-lite-mobile-detail] .monitor-content,
    html[data-lite-mobile-page="excel"][data-lite-mobile-detail] .container > div:not(.topbar, .tabs, .hidden) {
      animation: lite-screen-in .25s ease-out;
    }
  }
  @keyframes lite-screen-in {
    from { opacity: .68; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes lite-quote-glow {
    from { opacity: .45; }
    to { opacity: 1; }
  }
  @media (max-height: 650px) {
    html[data-lite-mobile-page="home"] body #app > .main { padding-block: 10px 14px; }
    html[data-lite-mobile-page="home"] .workspace-section { gap: 8px; }
    html[data-lite-mobile-page="home"] .workspace-heading { padding-block: 9px; }
    html[data-lite-mobile-page="home"] .lite-mobile-directory > .portal-card:not([hidden]) { min-height: 52px; }
    html[data-lite-mobile-page="home"] .portal-card .card-desc { -webkit-line-clamp: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    html[data-lite-mobile-page] .lite-mobile-directory > :is(a, button) { transition: none; }
  }
}
