/* 手机以值守和执行记录为主；桌面沿用原有布局。 */
.mw-page, .mw-detail-nav, .mw-detail-identity, .mw-nav, .mw-data-tools { display: none; }
@media (max-width: 767px) {
  body[data-mobile-view] { --mw-top: 54px; --mw-bottom: calc(50px + env(safe-area-inset-bottom)); }
  body[data-mobile-view] .topbar { display: flex !important; box-sizing: border-box; height: var(--mw-top) !important; min-height: var(--mw-top) !important; max-height: var(--mw-top) !important; padding: 5px 10px; gap: 6px; overflow: visible; z-index: 40; }
  body[data-mobile-view] .topbar > .brand-mark { flex: 0 0 30px; width: 30px !important; min-width: 30px !important; height: 30px !important; font-size: 19px; border-radius: 9px; }
  body[data-mobile-view] .topbar-brand { min-width: 0; flex: 1; }
  body[data-mobile-view] .topbar-brand > span, body[data-mobile-view] .topbar-global-status,
  body[data-mobile-view] .other-tools-trigger, body[data-mobile-view] .alarm-center-trigger,
  body[data-mobile-view] .account-menu-trigger, body[data-mobile-view] .mobile-account-handle,
  body[data-mobile-view] .mobile-workspace-nav { display: none !important; }
  body[data-mobile-view] .brand-title-row { min-width: 0; gap: 2px; }
  body[data-mobile-view] .workspace-switcher { min-width: 0; flex: 1; }
  body[data-mobile-view] .workspace-switcher-trigger { min-width: 0; max-width: 100%; min-height: 44px; }
  body[data-mobile-view] .workspace-switcher-trigger { font-size: 14px !important; }
  body[data-mobile-view] .workspace-switcher-trigger h1 { font-size: 14px; }
  body[data-mobile-view] .personal-mode-control { display: block !important; flex: 0 0 44px; order: 1; }
  body[data-mobile-view] .topbar .personal-mode-switch,
  body[data-mobile-view] .topbar .system-status-monitor { box-sizing: border-box; display: flex; flex: 0 0 44px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 44px; min-width: 44px; height: 44px; padding: 4px 2px; margin: 0; border: 1px solid #e3eaf2; border-radius: 10px; background: #f7f9fc; box-shadow: none; filter: none; text-align: center; transition: color 160ms ease; }
  body[data-mobile-view] .personal-mode-switch svg,
  body[data-mobile-view] .system-status-monitor-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  body[data-mobile-view] .personal-mode-switch strong,
  body[data-mobile-view] .system-status-monitor-copy strong { display: block; font-size: 9px; font-weight: 600; line-height: 11px; white-space: nowrap; }
  body[data-mobile-view] .system-status-monitor { color: var(--monitor-color); }
  body[data-mobile-view] .system-status-monitor-icon { width: 18px; height: 18px; border-radius: 0; background: transparent; }
  body[data-mobile-view] .system-status-monitor .system-status-monitor-copy { display: contents; }
  body[data-mobile-view] .system-status-monitor-copy small { display: none; }
  body[data-mobile-view] .personal-mode-switch:focus-visible,
  body[data-mobile-view] .system-status-monitor:focus-visible { outline: 2px solid #458bcc; outline-offset: 2px; }
  body[data-mobile-view] .topbar-connection-status { display: contents !important; }
  body[data-mobile-view] .topbar-connection-status [data-topbar-status] { display: none !important; }
  body[data-mobile-view] .account-menu { display: contents !important; }
  body[data-mobile-view] .topbar [hidden] { display: none !important; }
  body[data-mobile-view] .account-menu-panel, body[data-mobile-view] .other-tools-popover,
  body[data-mobile-view] .alarm-center-panel { position: fixed; top: var(--mw-top); left: 8px; right: 8px; width: auto; max-width: calc(100vw - 16px); max-height: calc(100dvh - var(--mw-top) - var(--mw-bottom) - 12px); overflow-y: auto; }
  body[data-mobile-view] .mw-page { display: block; position: absolute; inset: var(--mw-top) 0 var(--mw-bottom); padding: 8px 12px 16px; overflow-y: auto; overscroll-behavior: contain; background: #f5f8fc; z-index: 5; }
  body[data-mobile-view]:not([data-mobile-view="detail"]):not([data-mobile-view="data"]) .workspace,
  body[data-mobile-view]:not([data-mobile-view="data"]) .followup-analysis { display: none; }
  .mw-page *, .mw-detail-nav *, .mw-nav * { box-sizing: border-box; }
  .mw-page button { font: inherit; cursor: pointer; color: #314965; }
  .mw-page button:disabled { cursor: wait; }
  .mw-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
  .mw-page-heading h2 { font-size: 17px; margin: 0; }
  .mw-page-heading small { font-size: 11px; }
  .mw-connected { color: #22947b; }
  .mw-disconnected, .mw-error { color: #c34051; }
  .mw-error { font-size: 13px; overflow-wrap: anywhere; }
  .mw-summary { height: 46px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; border: 1px solid #e1e8f1; background: white; border-radius: 11px; margin: 4px 0 10px; }
  .mw-summary > * { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; border: 0; background: none; min-height: 44px; }
  .mw-summary > * + * { border-left: 1px solid #edf1f6; }
  .mw-summary b { font-size: 20px; font-variant-numeric: tabular-nums; }
  .mw-summary > :first-child b { color: #df5267; }
  .mw-summary > :nth-child(2) b { color: #2877ce; }
  .mw-summary button[aria-pressed="true"] { background: #edf5ff; box-shadow: inset 0 -2px #4a84bc; }
  .mw-summary button:first-child[aria-pressed="true"] { background: #fff3f5; box-shadow: inset 0 -2px #df5267; border-radius: 10px 0 0 10px; }
  .mw-alert { display: block; width: 100%; text-align: left; border: 1px solid #f3d6dc; background: #fff7f8; padding: 9px 11px; border-radius: 10px; }
  .mw-alert strong, .mw-alert span { display: block; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  .mw-alert strong { color: #bd4056; }
  .mw-alert span { color: #906071; }
  .mw-section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
  .mw-section-heading h3 { margin: 0; font-size: 14px; }
  .mw-section-heading button { background: none; border: 0; min-height: 44px; padding: 0 4px; font-size: 12px; color: #537695; }
  .mw-section-heading small { color: #7890a8; font-size: 12px; }
  .mw-runtime-card { display: block; width: 100%; border: 1px solid #e1e8f1; background: white; text-align: left; border-radius: 12px; padding: 11px; margin-bottom: 9px; }
  .mw-card-head { display: flex; gap: 9px; align-items: center; }
  .mw-avatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; color: #49857a; background: #e3f3ee; font-size: 16px; overflow: hidden; }
  .mw-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .mw-identity { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 3px; }
  .mw-identity strong { font-size: 14px; overflow-wrap: anywhere; }
  .mw-identity small { font-size: 11px; line-height: 1.4; color: #74849b; overflow-wrap: anywhere; }
  .mw-live-duration { display: block; width: max-content; max-width: 100%; padding: 0 5px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.5; }
  .mw-live-duration, .mw-detail-live.is-live, .mw-detail-context time { color: #cf3850; background: #fff1f3; border: 1px solid #ffd1d7; border-radius: 5px; }
  .mw-waiting { margin-top: 8px; }
  .mw-waiting summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; cursor: pointer; font-size: 13px; }
  .mw-waiting summary span { font-size: 11px; color: #8191a4; }
  .mw-state { max-width: 98px; padding: 4px 6px; border-radius: 6px; background: #eaf4ff; color: #337aca; font-size: 11px; line-height: 1.4; }
  .mw-state.is-danger, .mw-state.is-error { color: #bf3850; background: #fff0f2; }
  .mw-state.is-warning { color: #9f722c; background: #fff6e8; }
  .mw-state.is-healthy, .mw-state.is-completed { color: #308977; background: #edf7f3; }
  .mw-current { display: block; margin-top: 10px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
  .mw-next { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 6px; padding: 7px 8px; background: #f3f8fd; border-radius: 7px; font-size: 12px; }
  .mw-next span { overflow-wrap: anywhere; min-width: 0; }
  .mw-next time { flex-shrink: 0; color: #257ac4; font-weight: 600; font-variant-numeric: tabular-nums; }
  .mw-strategy-name { display: flex; justify-content: space-between; gap: 8px; color: #8592a3; font-size: 11px; margin-top: 7px; overflow-wrap: anywhere; }
  .mw-empty { padding: 18px 12px; border-radius: 9px; background: white; color: #78899d; font-size: 13px; text-align: center; }
  .mw-search { display: block; }
  .mw-search > span { position: absolute; width: 1px; height: 1px; overflow: hidden; }
  .mw-search input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #dce5ef; border-radius: 10px; background: white; font: inherit; font-size: 16px; }
  .mw-filter { display: flex; gap: 8px; margin: 8px 0; }
  .mw-filter button { border: 0; border-radius: 8px; min-height: 44px; padding: 0 15px; background: #eaf0f7; font-size: 13px; }
  .mw-filter button[aria-pressed="true"] { color: white; background: #368f7a; }
  .mw-account { border: 1px solid #e1e8f1; border-radius: 11px; background: white; margin: 8px 0; overflow: hidden; }
  .mw-account-head { display: flex; width: 100%; gap: 9px; align-items: center; text-align: left; border: 0; background: none; padding: 11px; }
  .mw-account-head > span:last-child { font-size: 11px; color: #719282; }
  .mw-account-head b { display: block; text-align: right; margin-top: 5px; }
  .mw-account-strategies { border-top: 1px solid #edf1f5; padding: 4px 10px; }
  .mw-account-strategies button { display: flex; flex-direction: column; gap: 5px; width: 100%; min-height: 55px; border: 0; border-bottom: 1px solid #edf1f5; background: none; padding: 10px 2px; text-align: left; font-size: 12px; overflow-wrap: anywhere; }
  .mw-account-strategies button span { color: #7089a4; }
  .mw-more-list { border: 1px solid #e0e8f1; border-radius: 12px; background: white; margin-top: 4px; overflow: hidden; }
  .mw-more-list button { display: flex; width: 100%; align-items: center; justify-content: space-between; text-align: left; padding: 11px 13px; min-height: 57px; border: 0; border-bottom: 1px solid #edf1f6; background: none; }
  .mw-more-list span { display: flex; flex-direction: column; gap: 4px; }
  .mw-more-list strong { font-size: 13px; }
  .mw-more-list small { font-size: 11px; color: #8794a7; }
  .mw-more-list b { font-size: 20px; font-weight: 400; color: #8e9fb1; }
  .mw-nav { box-sizing: border-box; position: absolute; bottom: 0; left: 0; right: 0; height: var(--mw-bottom); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid #e1e8f0; background: #fff; z-index: 35; }
  .mw-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; border: 0; background: none; color: #8493a7; font: inherit; font-size: 11px; }
  .mw-nav button[aria-current="page"] { color: #239781; }
  .mw-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .mw-detail-nav { display: flex; align-items: center; flex-shrink: 0; height: 44px; padding: 0 8px; gap: 3px; background: white; border-bottom: 1px solid #e3eaf1; }
  .mw-detail-nav > span { flex: 1; font-size: 11px; color: #8493a7; }
  .mw-detail-nav button { min-height: 44px; padding: 0 8px; background: none; border: 0; color: #59718d; font-size: 12px; }
  .mw-detail-nav button[aria-pressed="true"] { color: #278c7b; font-weight: 600; }
  .mw-graph-tools { position: absolute; right: 10px; bottom: calc(var(--mw-bottom) + 10px); background: white; border: 1px solid #e0e8f0; border-radius: 8px; z-index: 9; box-shadow: 0 3px 12px #16345214; }
  body[data-mobile-view="detail"] .app-shell { display: flex !important; flex-direction: column; padding-bottom: var(--mw-bottom); box-sizing: border-box; }
  body[data-mobile-view="detail"] .topbar { flex-shrink: 0; }
  .mw-detail-identity { display: block; flex-shrink: 0; padding: 10px 12px; background: white; border-bottom: 1px solid #e4ebf2; }
  .mw-detail-account { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
  .mw-detail-account .mw-identity strong { font-size: 15px; line-height: 1.4; }
  .mw-detail-account .mw-identity small { font-size: 12px; overflow-wrap: anywhere; }
  .mw-detail-live { font-size: 11px; color: #8a97a8; }
  .mw-detail-live.is-live { padding: 4px 7px; }
  .mw-detail-context { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin: 7px 0 0; font-size: 11px; color: #71839a; }
  .mw-detail-context span { min-width: 0; overflow-wrap: anywhere; }
  .mw-detail-context time { padding: 0 5px; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.5; }
  .mw-detail-identity p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: #586d87; overflow-wrap: anywhere; }
  body[data-mobile-view="detail"] .workspace { flex: 1; height: auto !important; min-height: 0 !important; }
  body[data-mobile-view="detail"] .main-panel { padding-bottom: 0 !important; }
  body[data-mobile-view="detail"] .strategy-toolbar:not(.mobile-open) { display: none !important; }
  body[data-mobile-view="detail"] .strategy-toolbar.mobile-open .strategy-account-meta { display: grid !important; grid-template-columns: 40px minmax(0, 1fr) !important; grid-template-rows: auto auto auto; grid-column: 1 / -1; width: 100%; column-gap: 10px; row-gap: 4px; height: auto; }
  body[data-mobile-view="detail"] .strategy-toolbar.mobile-open .strategy-account-meta > .account-avatar-wrap { grid-column: 1 !important; grid-row: 1 / 4 !important; width: 40px !important; height: 40px !important; }
  body[data-mobile-view="detail"] .strategy-toolbar.mobile-open .strategy-account-meta > strong { grid-column: 2 !important; grid-row: 1 !important; max-width: none; white-space: normal !important; overflow-wrap: anywhere; }
  body[data-mobile-view="detail"] .strategy-toolbar.mobile-open .strategy-account-meta > span:not(.account-avatar-wrap) { grid-column: 2 !important; grid-row: 2 !important; display: block !important; overflow: visible; text-overflow: clip; white-space: normal !important; overflow-wrap: anywhere; }
  body[data-mobile-view="detail"] .strategy-toolbar.mobile-open .strategy-account-meta > .strategy-account-state { grid-column: 2 !important; grid-row: 3 !important; justify-self: start; white-space: normal; }
  body[data-mobile-view="detail"] .strategy-toolbar:not(.mobile-open) .strategy-mobile-overview-trigger,
  body[data-mobile-view="detail"] .strategy-toolbar:not(.mobile-open) .strategy-tabs { display: none; }
  body[data-mobile-view="detail"] .strategy-toolbar:not(.mobile-open) .strategy-title-meta > span { display: block; font-size: 11px; }
  body[data-mobile-view="detail"] .strategy-toolbar:not(.mobile-open) .strategy-account-meta { pointer-events: none; }
  body[data-mobile-view="detail"] .execution-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 9px; }
  body[data-mobile-view="detail"] .execution-summary strong { font-size: 13px; overflow-wrap: anywhere; }
  body[data-mobile-view="detail"] .execution-summary small { font-size: 11px; }
  body[data-mobile-view="detail"] .execution-records-view { padding-bottom: 12px; }
  body[data-mobile-view="detail"] .execution-records-view { display: block; overflow-y: auto; }
  body[data-mobile-view="detail"] .execution-summary { margin-bottom: 10px; }
  body[data-mobile-view="detail"] .execution-record-grid { height: auto; overflow: visible; }
  body[data-mobile-view="detail"] .execution-record-grid > section,
  body[data-mobile-view="detail"] .execution-record-grid > .api-inspector { height: auto; overflow: visible; }
  body[data-mobile-view="detail"] .execution-record-grid .run-list { height: auto; max-height: none; overflow: visible; }
  body[data-mobile-view="detail"] .strategy-toolbar:not(.mobile-open) .strategy-title-meta > span { display: block !important; }
  body[data-mobile-view="detail"] .execution-record-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-mobile-view="detail"] .execution-record-grid .run-table { overflow-x: auto; }
  body[data-mobile-view="detail"] .mobile-inspector-drawer,
  body[data-mobile-view="detail"] .node-palette.mobile-open { position: fixed; bottom: calc(var(--mw-bottom) + 6px) !important; max-height: calc(100dvh - var(--mw-top) - var(--mw-bottom) - 12px) !important; }
  body[data-mobile-view="detail"] .mobile-inspector-drawer:not(.mobile-open),
  body[data-mobile-view="detail"] .node-palette:not(.mobile-open) { display: none !important; }
  body[data-mobile-view="data"] .followup-analysis { height: calc(100dvh - var(--mw-top) - var(--mw-bottom)); min-height: 0; padding-bottom: 8px; }
  body[data-mobile-view="data"] .analysis-view-content { margin-bottom: var(--mw-bottom); }
  body[data-mobile-view="data"] .live-analysis { padding: 10px 12px 18px; }
  body[data-mobile-view="data"] .live-analysis-chart-card { padding: 12px; border-radius: 11px; }
  body[data-mobile-view="data"] .live-filter-card { padding: 10px; }
  body[data-mobile-view="data"] .live-filter-row { gap: 6px; }
  body[data-mobile-view="data"] .live-filter-row button { min-height: 40px; }
  body[data-mobile-view="data"] .live-analysis-chart { height: 360px; }
  body[data-mobile-view="data"] input, body[data-mobile-view="data"] select { font-size: 16px; }
  .mw-data-tools { position: absolute; top: calc(var(--mw-top) + 44px); left: 0; right: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid #e5edf3; background: white; z-index: 6; }
  .mw-data-tools button { min-height: 44px; border: 0; background: transparent; color: #398c7d; font-size: 12px; padding: 0 5px; }
  .mw-data-tools span { font-size: 11px; color: #8594a5; }
  body[data-mobile-view="data"] .analysis-view-tabs { height: 44px; min-height: 44px; padding: 2px 12px; }
  body[data-mobile-view="data"] .analysis-view-tabs button { min-height: 40px; padding: 4px 12px; }
  body[data-mobile-view="data"] .live-analysis { display: flex; flex-direction: column; gap: 10px; padding: 54px 12px 18px; }
  body[data-mobile-view="data"] .live-analysis-status { order: 4; }
  body[data-mobile-view="data"][data-mobile-filters="closed"] .live-analysis-filter-card,
  body[data-mobile-view="data"][data-mobile-legend="closed"] .live-minute-legend { display: none; }
  body[data-mobile-view="data"][data-mobile-filters="open"] .live-analysis-filter-card { position: fixed; top: calc(var(--mw-top) + 88px); left: 8px; right: 8px; max-height: calc(100dvh - var(--mw-top) - 96px - var(--mw-bottom)); overflow-y: auto; z-index: 20; box-shadow: 0 8px 24px #24374f26; }
  body[data-mobile-view="data"] .live-minute-legend .live-legend-item { width: 100%; min-height: 44px; max-width: none; align-items: flex-start; }
  body[data-mobile-view="data"] .live-minute-legend .live-legend-item span { white-space: normal; overflow-wrap: anywhere; }
  body[data-mobile-view="data"] .live-analysis-chart-card > header { flex-wrap: wrap; gap: 4px; }
  body[data-mobile-view="data"] .live-analysis-chart-card > header h3 { font-size: 14px; }
  body[data-mobile-view="data"] .live-analysis-chart-card > header span { font-size: 11px; }
  body[data-mobile-view="data"] .live-analysis-note { font-size: 11px; line-height: 1.5; margin: 6px 0; }
  body[data-mobile-view="data"] .live-analysis-table { overflow: auto; }
  body[data-mobile-view="data"] .live-analysis-status > summary { min-height: 44px; flex-wrap: wrap; gap: 6px; }
  body[data-mobile-view] .management-backdrop { padding: 8px !important; }
  body[data-mobile-view] .management-panel { box-sizing: border-box; min-width: 0 !important; width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important; max-height: calc(100dvh - 16px); padding: 16px !important; overflow-y: auto; }
  body[data-mobile-view] .management-panel > header { min-width: 0; gap: 8px; }
  body[data-mobile-view] .management-panel > header > div { min-width: 0; }
  body[data-mobile-view] .management-panel > header button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
}
