/* =========================================================
   mobile.css - 苹果手机 / 手机端专用界面层（iPhone 优先）
   ---------------------------------------------------------
   设计原则（务必保持）：
     1. 只在手机尺寸生效（@media max-width:820px 或 手机横屏矮屏），
        桌面 16:10 大屏样式与布局一行都不改；
     2. 抽屉式侧栏 + 底部 Tab + 全屏底部弹窗，做出"原生 APP"手感；
     3. 所有内容避让刘海/底部小横条（env(safe-area-inset-*)）；
     4. 表格横向可滑动，不挤成一条线；输入框字号≥16px（iOS 聚焦不放大）。
   ========================================================= */

/* ---------- 基础：只在手机生效 ---------- */
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) {

  html, body { height: 100%; }
  body {
    font-size: 15px;
    height: 100dvh;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
  }
  #appView, .layout { height: 100dvh; }
  .main { height: 100dvh; }

  /* 输入类：统一 16px，避免 iOS 聚焦自动放大页面 */
  input, select, textarea { font-size: 16px; padding: 10px 12px; min-height: 44px; }
  button, .btn { min-height: 40px; font-size: 14.5px; }
  .btn.sm { min-height: 32px; font-size: 13px; padding: 5px 10px; }

  /* ---------- 隐藏桌面大屏装饰层（省电、防卡顿） ---------- */
  .deco-canvas, .deco-tint, .wf-canvas, .jv-layer,
  .holo-frame, .hf-ring, .hf-particles, .hf-pillars,
  .pc-lock-toggle, #fullscreenAlert .fa-deco,
  #sodaCard, .soda-capsule, .music-soda { display: none !important; }

  /* 16:10 锁定在手机上永不生效（手机大屏改为自适应满屏） */
  body.pc-lock { display: block !important; overflow: hidden !important; background: var(--bg) !important; }
  body.pc-lock .layout { width: 100% !important; height: 100dvh !important; }

  /* ---------- 顶栏：汉堡 + 面包屑 + 灌季 + 年份 ---------- */
  .topbar {
    height: auto;
    min-height: 52px;
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
    gap: 6px;
    align-items: center;
    border-bottom: 1px solid var(--border);
  }
  .m-burger {
    display: -webkit-box;
    display: flex;
    width: 38px; height: 38px;
    flex: 0 0 38px;
    align-items: center; justify-content: center;
    background: rgba(56, 189, 248, .12);
    border: 1px solid rgba(56, 189, 248, .38);
    border-radius: 10px;
    color: #cfe9ff;
  }
  .m-burger svg { width: 20px; height: 20px; }
  .topbar .crumb { max-width: none; flex: 1 1 auto; font-size: 15px; min-width: 0; }
  .topbar .role-tag, .topbar .avatar, #userName, .topbar .ai-top-mode, .topbar .btn-logout { display: none !important; }
  /* 手机端年份/灌季移到 hero 卡片内，顶栏不再显示 */
  .topbar #irrYearSel, .topbar #irrYearBtn, .topbar #irrSeasonSel { display: none !important; }
  /* 手机端品牌位：logo + 单位名，替换面包屑 */
  .m-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .m-brand-logo { width: 28px; height: 28px; object-fit: contain; flex: 0 0 28px; }
  .topbar .crumb .m-brand span { font-size: 18px; font-weight: 800; color: #f2f9ff; white-space: nowrap; letter-spacing: .3px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }

  /* 工具条：手机上纵向排布，按钮整行、筛选条件各占一行，避免标签被挤到输入框右侧 */
  .content .toolbar { display: block !important; }
  .content .toolbar .spacer { display: none !important; }
  .content .toolbar label { display: block; margin: 10px 0 4px; font-size: 13px !important; color: var(--muted); }
  .content .toolbar > select, .content .toolbar > input { width: 100% !important; margin-bottom: 4px; }
  .content .toolbar > span { display: block !important; width: 100% !important; }
  .content .toolbar .btn { margin: 0 6px 8px 0; }

  /* ---------- 内容区 ---------- */
  .content {
    padding: 12px 12px calc(60px + env(safe-area-inset-bottom)) !important;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .layout:not(.home) .content { padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important; }

  .card { border-radius: 12px; margin-bottom: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
  .card-head { padding: 12px 14px; flex-wrap: wrap; gap: 6px; }
  .card-head h3 { font-size: 16px; }
  .card-head .desc { font-size: 12.5px; margin-left: 4px; }
  .card-body { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
  .stat-card { padding: 12px; border-radius: 12px; }
  .stat-card .label { font-size: 12.5px; margin-bottom: 6px; }
  .stat-card .num { font-size: 20px; }
  .stat-card .ico { font-size: 20px; right: 8px; top: 8px; }

  /* 工具栏：按钮换行、搜索框独占一行 */
  .toolbar { gap: 8px; }
  .toolbar input { width: 100% !important; flex: 1 1 100%; }
  .toolbar select { flex: 1 1 46%; width: auto !important; }
  .toolbar .spacer { display: none; }

  /* 表格：横向滑动，列不被压扁 */
  .table-wrap { border-radius: 10px; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table:not(.kq):not(.kq-plan), .content table:not(.kq):not(.kq-plan) { min-width: 0 !important; width: 100%; }
  .content table th, .content table td {
    padding: 7px 8px; font-size: 12.5px !important; line-height: 1.45;
    white-space: normal; word-break: break-word;
  }
  .content table th { font-size: 12.5px !important; }
  /* 通讯录等自带 18px 大字号（id 选择器）的表格，手机端统一压到 13px */
  #abTable table, #abTable th, #abTable td { font-size: 13px !important; }
  /* 列多的宽表：禁止逐字断行，整表横向滑动 */
  .table-wrap table.m-tbl-wide th, .table-wrap table.m-tbl-wide td { white-space: nowrap; }
  /* 带操作列的流水表：按钮竖排成窄列，正文列自动获得剩余宽度 */
  .table-wrap table.m-act th:last-child, .table-wrap table.m-act td:last-child { white-space: normal; }
  .table-wrap table.m-act td:last-child .btn {
    display: flex; width: 100%; min-height: 30px; margin: 0 0 6px; padding: 4px 6px;
    justify-content: center; font-size: 12px;
  }
  .table-wrap table.m-act td:last-child .btn:last-child { margin-bottom: 0; }
  #abTable td:nth-child(7) { white-space: normal; }
  .kq { font-size: 14px; min-width: 860px; }
  .kq th, .kq td { font-size: 14px !important; padding: 6px 6px !important; }
  .kq input, .kq select { font-size: 14px !important; min-height: 38px; padding: 4px 6px !important; }
  .content .kq-plan th, .content .kq-plan td { height: auto; }

  /* ---------- 表单 / 弹窗：底部抽屉式全屏 ---------- */
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.lg, .modal.xm, .modal.xl {
    width: 100% !important; max-width: 100% !important;
    border-radius: 18px 18px 0 0;
    max-height: 94dvh;
    display: flex; flex-direction: column;
    border-bottom: none;
  }
  .modal-head { padding: 14px 16px 10px; position: relative; }
  .modal-head h3 { font-size: 16.5px; }
  .modal-head .x { font-size: 24px; width: 36px; height: 36px; }
  /* 抽屉顶部小横条 */
  .modal-head::before {
    content: ''; position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 2px; background: rgba(159, 183, 208, .45);
  }
  .modal-body { padding: 12px 16px; flex: 1 1 auto; max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-foot {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    position: -webkit-sticky; position: sticky; bottom: 0;
    background: linear-gradient(180deg, rgba(10, 32, 58, .92), rgba(7, 22, 42, .98));
    backdrop-filter: blur(6px);
    gap: 8px;
  }
  .modal-foot .btn { flex: 1; min-height: 44px; }
  .form-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .modal-body .field input, .modal-body .field select { height: 44px; }
  .modal-body .field label { font-size: 13px; }

  /* 提示条 / 徽标 */
  .alert { padding: 10px 12px; font-size: 13px; }
  .badge { font-size: 12.5px; padding: 2px 7px; }

  /* AI 面板：手机上不挂底部面板（用底部 Tab 的“智能体”） */
  .ai-panel { display: none !important; }

  /* 登录页 */
  .login-wrap { height: 100dvh; padding: 16px calc(16px + env(safe-area-inset-left)); align-items: center; }
  /* 登录卡：与电脑版完全同一套浅蓝玻璃（不再单独改深色底/配色），手机只收尺寸 */
  .login-card {
    width: 100%; max-width: 460px; padding: 26px 20px; border-radius: 20px;
  }
  .login-card h1 { font-size: 23px; }
  .login-card .logo .mark { max-height: 44px; max-width: 56px; }
  .login-card label { font-size: 14px; margin: 16px 0 7px; }
  .login-card input { height: 48px; padding: 12px 14px; font-size: 16px; }
  .login-card .btn-login { height: 48px; font-size: 17px; letter-spacing: 4px; min-height: 48px; }
  .login-card .tips { font-size: 12.5px; line-height: 1.8; padding: 12px; }

  /* 首页大屏（桌面驾驶舱）在手机上不再使用，兜底隐藏左右悬浮栏 */
  .layout.home .dash-top, .layout.home .dash-bottom { display: none !important; }

  /* 侧栏改抽屉：默认隐藏，点汉堡滑出 */
  .sidebar {
    position: fixed; z-index: 80;
    left: 0; top: 0; bottom: 0;
    width: min(78vw, 320px);
    transform: translateX(-104%);
    transition: transform .26s cubic-bezier(.22, .61, .36, 1);
    box-shadow: 12px 0 34px rgba(0, 0, 0, .55);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex !important;
    will-change: transform;
  }
  .sidebar.m-open { transform: translateX(0); }
  body.m-drawer .m-drawer-mask { opacity: 1; pointer-events: auto; }
  .m-drawer-mask {
    position: fixed; inset: 0; z-index: 70;
    background: rgba(2, 8, 18, .58);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .22s;
  }
  .sidebar .brand { padding: 14px; }
  .sidebar .brand .title { font-size: 16px; }
  .sidebar .nav { padding: 4px 0 8px; }
  .nav-item { padding: 12px 16px; font-size: 15px; }
  .nav-group-title { padding: 13px 14px; font-size: 14px; }
  .nav-group-body .nav-item { padding-left: 30px; }
  .sidebar-clock { display: none !important; }   /* 抽屉里不需要大屏时钟，避免占满底部 */
  .sidebar-foot { display: none; }   /* 手机抽屉底部改用 m-drawer-foot（带退出按钮），避免账号重复两行 */

  /* 抽屉底部：账号 + 退出 */
  .m-drawer-foot {
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
    flex: 0 0 auto;
  }
  .m-drawer-foot .who { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-drawer-foot .out {
    padding: 7px 12px; border-radius: 8px; font-size: 13px;
    background: rgba(244, 63, 94, .14); border: 1px solid rgba(244, 63, 94, .5); color: #ffb0bd;
  }

  /* ---------- 底部 Tab ---------- */
  .m-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: rgba(5, 18, 34, .96);
    border-top: 1px solid rgba(56, 189, 248, .28);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .4);
    backdrop-filter: blur(10px);
  }
  .m-tabbar .m-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: #7f9cb8; font-size: 11px; background: none;
    padding: 4px 0 2px; border: none;
  }
  .m-tabbar .m-tab svg { width: 21px; height: 21px; }
  .m-tabbar .m-tab.on { color: #46caff; }
  .m-tabbar .m-tab.on::before {
    content: ''; position: absolute; top: 0; width: 30px; height: 2px;
    border-radius: 2px; background: #46caff; box-shadow: 0 0 8px rgba(70, 202, 255, .8);
  }
  .m-tabbar .m-tab { position: relative; }

  /* 2026-11-21 用户要求：首页不再有 AI 悬浮球（底部 Tab 已有「智能体」），
     旧节点万一残留也强制隐藏，避免挡内容。 */
  .m-fab { display: none !important; }

  /* ---------- 手机首页看板 ---------- */
  .m-home { padding-bottom: 0; }
  .m-hero {
    position: relative; overflow: hidden;
    border-radius: 16px;
    padding: 14px 14px 12px;
    background:
      radial-gradient(120% 120% at 100% 0%, rgba(70, 202, 255, .28) 0%, transparent 55%),
      linear-gradient(160deg, #14406e 0%, #0d2c50 55%, #0a2039 100%);
    border: 1px solid rgba(70, 202, 255, .34);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .06);
    margin-bottom: 12px;
    display: flex; flex-direction: column; gap: 7px; z-index: 2;
  }
  .m-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .m-hero-body { display: flex; gap: 12px; align-items: center; }
  .m-hero::after {
    content: ''; position: absolute; right: -64px; bottom: -96px;
    width: 150px; height: 150px; border-radius: 50%;
    border: 1px solid rgba(70, 202, 255, .12);
    box-shadow: 0 0 0 22px rgba(70, 202, 255, .03), 0 0 0 44px rgba(70, 202, 255, .02);
  }
  .m-hero-l { flex: 1.15; min-width: 0; display: flex; flex-direction: column; position: relative; z-index: 2; }
  .m-hero-r { flex: 0.85; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; position: relative; z-index: 2; }

  .m-hero .m-clock { flex: 1; text-align: center; font-size: 16px; font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
  .m-hero .m-day { flex: 0 0 auto; font-size: 12px; color: #bcd7ee; white-space: nowrap; }
  .m-weather { flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: #bcd7ee; white-space: nowrap; }
  .m-weather .mw-main { display: inline-flex; align-items: center; gap: 4px; }
  .m-weather .mw-ico { font-size: 13px; line-height: 1; }
  .m-weather .mw-desc { color: #cfe0f0; }
  .m-weather .mw-temp { color: #f5a623; font-weight: 600; font-variant-numeric: tabular-nums; }
  .m-weather .mw-wind { font-size: 10.5px; color: #8fb4d9; }
  /* 2026-11-23 用户要求：年头+季节标签往上收一点，别和上面「星期一」那行隔太远 */
  .m-period { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: -6px;
    font-size: 12px; letter-spacing: .3px; white-space: nowrap;
    padding: 3px 10px; border-radius: 8px;
    background: rgba(70, 202, 255, .12); border: 1px solid rgba(70, 202, 255, .3); }
  .m-period .mp-y { color: #cfe6f7; font-weight: 600; }
  .m-period .mp-sep { color: #5f87ad; }
  .m-period .mp-s { color: #ffd257; font-weight: 800; }

  /* 庙坡站运行状况：工况三行 + 分档天数小字条 */
  .m-pt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding-bottom: 7px; border-bottom: 1px solid rgba(70, 202, 255, .18); }
  .m-pt-head .t { font-size: 12.5px; font-weight: 700; color: #eaf7ff; white-space: nowrap; }
  .m-pt-head .d { font-size: 11.5px; color: #8fb4d9; white-space: nowrap; }
  .m-pt-head .d b { color: #46caff; font-size: 16px; font-weight: 800; margin: 0 2px; }
  .m-pt-list { display: flex; flex-direction: column; }
  .m-pt-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; }
  .m-pt-row .lb { font-size: 11.5px; color: #8fb4d9; white-space: nowrap; }
  .m-pt-row .vl { flex: 1; display: flex; align-items: baseline; justify-content: center; font-size: 15px; color: #eaf7ff; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .m-pt-row .vl small { font-size: 10.5px; color: #8fb4d9; font-weight: 500; margin-left: 1px; }
  .m-pt-days { display: flex; gap: 14px; margin-top: 7px; padding-top: 8px; border-top: 1px solid rgba(70, 202, 255, .12); font-size: 11.5px; color: #8fb4d9; white-space: nowrap; }
  .m-pt-days b { color: #eaf7ff; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0 2px; }
  .m-pt-days small { font-size: 10.5px; color: #8fb4d9; font-weight: 500; }

  /* 任务完成率圆环 */
  .m-ring { position: relative; width: 112px; height: 112px; }
  .m-ring::before { content: ''; position: absolute; inset: -12px; border-radius: 50%;
    background: radial-gradient(circle, rgba(8, 24, 45, .6) 0%, rgba(8, 24, 45, 0) 72%); }
  .m-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
  .m-ring-track { fill: none; stroke: rgba(70, 110, 150, .28); stroke-width: 18; }
  .m-ring-val { fill: none; stroke: url(#mRingGrad); stroke-width: 18; stroke-linecap: round; filter: drop-shadow(0 0 7px rgba(64, 160, 224, .6)); }
  .m-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .m-ring-c .pct { font-size: 23px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
  .m-ring-c .pct small { font-size: 13px; }
  .m-ring-c .cap { font-size: 11px; color: #9fc6e8; margin-top: 3px; }
  .m-legend { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: #cfe0f0; }
  .m-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
  .m-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .m-legend .dot.red { background: #ff8fa3; }
  .m-legend .dot.green { background: #34d399; }
  .m-legend b { font-weight: 700; color: #eaf7ff; }
  .m-legend small { font-size: 10.5px; color: #8fb4d9; margin-left: 2px; }

  /* ---------- 页签模块：各站机组 / 支渠任务 ---------- */
  .m-tabs { display: flex; gap: 6px; margin: 0 2px 8px; background: rgba(11, 34, 64, .6); border: 1px solid rgba(40, 84, 127, .9); border-radius: 12px; padding: 4px; }
  .m-tabs .mtab { flex: 1; min-height: 38px; padding: 0 3px; border: none; background: transparent; color: #8fb4d9;
    font-size: 12.5px; font-weight: 400; line-height: 1.25; letter-spacing: 0; border-radius: 9px; white-space: nowrap; }
  /* 选中蓝条方向分两排：下排两个页签（快捷业务/今日值班）蓝条贴上沿；上排三个页签蓝条贴下沿 */
  .m-tabs .mtab.on { background: rgba(70, 202, 255, .16); color: #7fd1ff; font-weight: 700; box-shadow: inset 0 2px 0 #46caff; }
  .m-tabs.mtabs3 .mtab.on { box-shadow: inset 0 -2px 0 #46caff; }
  /* 上排三页签与下排统一字号/字重/字距，仅因文字较长保留更紧的内边距，避免撑破三栏 */
  .m-tabs.mtabs3 .mtab { padding: 0 1px; }
  .m-pane { margin-bottom: 10px; border-radius: 14px; border: 1px solid rgba(40, 84, 127, .9); background: linear-gradient(170deg, rgba(18, 48, 88, .95), rgba(9, 28, 52, .95)); overflow: hidden; }

  /* 机组页：每站一行，状态点横排 */
  .mp-row { display: grid; grid-template-columns: 60px 1fr 52px; align-items: center; gap: 8px; padding: 8px 12px; min-height: 39px; border-bottom: 1px solid rgba(40, 84, 127, .4); }
  .mp-row:last-child { border-bottom: none; }
  .mp-row.mp-head { min-height: 30px; }
  .mp-head { border-bottom: 1px solid rgba(70, 202, 255, .18); padding-top: 7px; padding-bottom: 7px; }
  .mp-head .mp-name, .mp-head .mp-dots, .mp-head .mp-days { font-size: 11px; font-weight: 500; color: #8fb4d9; }
  .mp-head .mp-name { justify-self: end; }
  .mp-head .mp-dots { display: flex; justify-content: center; grid-template-columns: none; }
  .mp-head .mp-days { justify-self: start; }
  .mp-name { font-size: 13px; color: #eaf7ff; justify-self: end; }
  .mp-dots { display: grid; grid-template-columns: repeat(6, 1fr); justify-items: center; gap: 2px 4px; }
  .mp-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .mp-no { font-size: 11px; color: #b7e4ff; line-height: 1; }
  .mp-dot { width: 9px; height: 9px; border-radius: 50%; background: #25384c; display: inline-block; }
  .mp-dot.on { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, .8); }
  .mp-days { font-size: 13px; font-weight: 700; color: #eaf7ff; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; justify-self: start; }
  .mp-days small { font-size: 10.5px; color: #8fb4d9; font-weight: 500; margin-left: 2px; }

  /* 支渠页：两列网格扁平条目 */
  .mb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 8px 12px; }
  .mb-item { min-width: 0; }
  .mb-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
  .mb-name { font-size: 12px; color: #cfe0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mb-right { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
  .mb-flow { font-size: 11px; color: #6b86a6; font-variant-numeric: tabular-nums; }
  .mb-flow.on { color: #34d399; }
  .mb-flow small { font-size: 9px; color: #8fb4d9; margin-left: 2px; }
  .mb-flow.on small { color: rgba(52, 211, 153, .75); }
  .mb-dot { width: 7px; height: 7px; border-radius: 50%; background: #5a6b80; display: inline-block; }
  .mb-dot.on { background: #34d399; }
  .mb-pct { font-size: 12px; color: #eaf7ff; font-weight: 700; font-variant-numeric: tabular-nums; }
  .mb-bar { margin-top: 5px; height: 5px; border-radius: 3px; background: rgba(70, 110, 150, .25); overflow: hidden; }
  .mb-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #40a0e0, #34d399); }

  .m-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 8px; }
  .m-sec h3 { font-size: 14px; color: #e8f4ff; font-weight: 700; }
  .m-sec h3::before {
    content: ''; display: inline-block; width: 3px; height: 13px; margin-right: 8px;
    vertical-align: -1px; border-radius: 2px;
    background: linear-gradient(180deg, #46caff, #1d7fe0); box-shadow: 0 0 8px rgba(70, 202, 255, .6);
  }
  .m-sec .more { font-size: 12px; color: #7fa3c4; }

  .m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .m-grid .g {
    background: linear-gradient(170deg, rgba(19, 51, 94, .92), rgba(10, 30, 56, .92));
    border: 1px solid rgba(40, 84, 127, .85);
    border-radius: 14px; padding: 10px 4px 9px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: #cfe0f0; font-size: 11.5px; text-align: center;
    transition: transform .15s, border-color .15s;
  }
  .m-grid .g:active { transform: scale(.96); border-color: #46caff; }
  .m-grid .g .gi {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 0;
    color: #7fd1ff;
  }
  .m-grid .g .gi svg { width: 21px; height: 21px; }
  .m-grid .g span { line-height: 1.25; }

  .m-duty {
    border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(40, 84, 127, .9);
    background: linear-gradient(170deg, rgba(18, 48, 88, .95), rgba(9, 28, 52, .95));
  }
  #paneGrid .m-grid { padding: 10px 12px; }
  #paneDuty .m-duty { border: none; background: transparent; border-radius: 0; }
  /* 面板为固定高度，内部容器撑满并纵向均分，避免较矮面板底部留一块空白 */
  #paneGrid, #paneDuty { display: flex; flex-direction: column; }
  #paneGrid .m-grid { flex: 1 1 auto; grid-template-rows: repeat(3, 1fr); }
  /* 宫格下方通栏：外部「东雷二期抽黄灌区信息平台」入口（2026-11-24 新增） */
  .m-ext-link {
    flex: 0 0 auto;
    margin: 0 12px 10px;
    min-height: 46px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(170deg, rgba(19, 51, 94, .92), rgba(10, 30, 56, .92));
    border: 1px solid rgba(40, 84, 127, .85);
    border-radius: 14px;
    color: #cfe0f0; font-size: 12px; line-height: 1.3; text-decoration: none; text-align: center;
    transition: transform .15s, border-color .15s;
  }
  .m-ext-link:active { transform: scale(.98); border-color: #46caff; }
  .m-ext-link .gi { display: flex; align-items: center; color: #7fd1ff; }
  .m-ext-link .gi svg { width: 20px; height: 20px; }
  #paneDuty .m-duty { flex: 1 1 auto; display: flex; flex-direction: column; }
  /* 机组开机：表头固定，四站在整块高度内等距分布 */
  #panePump { display: flex; flex-direction: column; }
  #panePump .mp-row { flex: 1 1 0; min-height: 0; }
  #panePump .mp-row.mp-head { flex: 0 0 30px; }
  /* 支渠完成：两列条目按可用高度等分行距，极窄屏单列时同样均分 */
  #paneBranch { display: flex; flex-direction: column; }
  #paneBranch .mb-grid { flex: 1 1 auto; grid-auto-rows: 1fr; }
  #paneBranch .mb-item { display: flex; flex-direction: column; justify-content: center; }
  .m-duty .row {
    display: flex; align-items: center; gap: 10px; flex: 1 1 0;
    padding: 8px 12px; border-bottom: 1px solid rgba(40, 84, 127, .55);
  }
  .m-duty .row:last-child { border-bottom: none; }
  .m-duty .rm { flex: 1; min-width: 0; }
  .m-duty .rm b { display: block; font-size: 14px; color: #eaf7ff; font-weight: 600; }
  .m-duty .rm-line { display: flex; align-items: center; gap: 7px; }
  .m-duty .rm-line b { display: inline; }
  .m-duty .rm .duty-role { font-size: 14px; color: #8fb4d9; white-space: nowrap;
    border: none; background: transparent; padding: 0; border-radius: 0; }
  .m-duty .rm .duty-role.role-white { color: #eaf7ff; }
  .m-duty .rm span { font-size: 11.5px; color: #8fb4d9; }
  .m-duty .rbtns { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
  .m-duty .tel {
    display: inline-flex; align-items: center;
    padding: 4px; border: none; border-radius: 0; background: transparent;
    color: #6ee7b7; white-space: nowrap;
  }
  .m-duty .tel .ph-ic { width: 18px; height: 18px; }
  .m-duty .ph-title { flex: 0 0 auto; }
  .m-duty .ph-title b { color: #eaf7ff; }
  .m-duty .ph-cells { display: flex; flex-wrap: nowrap; gap: 10px; flex: 1; min-width: 0; justify-content: flex-end; }
  .m-duty .ph-cell { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; }
  .m-duty .ph-line { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
  .m-duty .ph-num { font-size: 12px; color: #cfe6f7; }

  .m-dyn {
    border-radius: 14px; border: 1px solid rgba(40, 84, 127, .9);
    background: rgba(11, 34, 64, .6); overflow: hidden;
  }
  /* 调度动态并入页签后：页签内不再套一层卡片边框，列表限高并在内部滚动，避免把整框撑高 */
  .m-dyn-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 10px 6px; }
  /* 页签内纵向排布：按钮行固定高度，列表 flex 撑满整个页签框。
     高度由 fixPaneHeights 与其他页签锁齐，列表长了就在框内滚动，不再把整框撑高或缩回去。 */
  #paneDynLog { display: flex; flex-direction: column; }
  #paneDynLog .m-dyn-bar { flex: 0 0 auto; }
  #paneDynLog .m-dyn {
    border: none; border-radius: 0; background: transparent;
    flex: 1 1 auto; min-height: 0; max-height: none;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;                 /* 内容超出才出条，没超出就不占位 */
    scrollbar-color: rgba(70, 202, 255, .55) transparent;
  }
  /* 右侧滚动条：只在条目超出框高时出现，细条、半透明蓝，不挤压文字宽度 */
  #paneDynLog .m-dyn::-webkit-scrollbar { width: 4px; }
  #paneDynLog .m-dyn::-webkit-scrollbar-track { background: transparent; }
  #paneDynLog .m-dyn::-webkit-scrollbar-thumb {
    background: rgba(70, 202, 255, .55); border-radius: 3px;
  }
  .m-dyn .it {
    display: flex; gap: 10px; padding: 10px 12px;
    border-bottom: 1px solid rgba(40, 84, 127, .4);
  }
  .m-dyn .it:last-child { border-bottom: none; }
  .m-dyn .it .tm { font-size: 11px; color: #7fd1ff; font-variant-numeric: tabular-nums; width: 64px; flex: 0 0 64px; padding-top: 2px; line-height: 1.35; }
  .m-dyn .it .tx { flex: 1; min-width: 0; font-size: 13px; color: #cfe0f0; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .m-dyn .it .tx b { color: #eaf7ff; font-weight: 600; margin-right: 4px; }
  /* 2026-11-23 单条删除 ×（删 duty_log；原来语音录入的动态列表里没有删除入口） */
  .m-dyn .it .it-x {
    flex: 0 0 auto; align-self: flex-start; width: 26px; height: 26px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: none; color: #6f8798; font-size: 18px; line-height: 1;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .m-dyn .it .it-x:active { color: #ff6b6b; }
  .m-dyn .empty2 { padding: 18px; text-align: center; color: #7fa3c4; font-size: 12.5px; }
  /* 2026-11-23 调度动态标题行：语音输入按钮（说一句 → 自动记一条动态） */
  .m-sec-right { display: inline-flex; align-items: center; gap: 8px; }
  /* 调度动态右按钮：与电脑版同一套观感（清屏粉、微信导入青），手机上下加大热区 */
  .m-dyn-btn {
    font-size: 12px; line-height: 1; padding: 7px 10px; border-radius: 8px;
    border: 1px solid rgba(70, 202, 255, .5); background: rgba(12, 77, 122, .45); color: #9fe0ff;
    -webkit-tap-highlight-color: transparent;
  }
  .m-dyn-btn:active { transform: scale(.96); }
  .m-dyn-btn.m-dyn-clear { color: #ff8fa3; border-color: rgba(255, 143, 163, .5); background: rgba(255, 143, 163, .1); }
  .m-sec-mic {
    width: 30px; height: 30px; border-radius: 50%; padding: 0;
    border: 1px solid rgba(70, 202, 255, .55); background: rgba(12, 77, 122, .55);
    color: #9fe0ff; display: inline-flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  .m-sec-mic svg { width: 15px; height: 15px; }
  .m-sec-mic:active { transform: scale(.95); }
  .m-sec-mic.on {
    background: #0f5c8f; border-color: #46caff; color: #fff;
    box-shadow: 0 0 12px rgba(70, 202, 255, .65); animation: mdiPulse 1.2s ease-in-out infinite;
  }
  @keyframes mdiPulse { 0%,100% { box-shadow: 0 0 8px rgba(70,202,255,.45); } 50% { box-shadow: 0 0 18px rgba(70,202,255,.85); } }

  /* ---------- SI 智能体（手机）：只留对话框 ----------
     2026-11-21 用户要求：手机端智能体页只要对话面板，
     业务知识库 / 台账图像解析（右栏）与分隔条在手机上不再显示，
     对话面板直接撑满顶栏与底部 Tab 之间的可用高度。 */
  .ai3-wrap { flex-direction: column !important; height: auto !important; min-height: 0 !important; font-size: 14px; }
  .ai3-col { flex: none !important; width: 100% !important; }
  .ai3-col-side { display: none !important; }
  .ai3-split { display: none !important; }
  .ai3-panel { height: calc(100dvh - 138px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
               margin-bottom: 0; border-radius: 12px; overflow: hidden; }
  /* 2026-11-21 用户要求：手机端去掉「当前：苹果Mac·xx 在线」这行绿色在线状态条
     与「模型用途」输入条，把高度全留给对话；标题也省掉（底部 Tab 已写「智能体」），
     头部只留模型/留痕按钮，尽量一行放完。 */
  .ai3-mode-bar, .ai3-purpose-bar, .ai3-panel-title { display: none !important; }
  .ai3-panel-head { padding: 6px 8px; flex-wrap: nowrap; gap: 6px; }
  .ai3-panel-head .spacer { display: none; }
  .ai3-btn { font-size: 12.5px; padding: 6px 9px; min-height: 34px; }
  .ai3-model { font-size: 13px; max-width: 48%; min-height: 34px; padding: 4px 6px; }
  .ai3-chat-log { padding: 8px; gap: 8px; }
  .ai3-bubble { padding: 8px 10px; font-size: 14px; }
  .ai3-msg { max-width: 100%; }
  .ai3-msg-img { max-width: 140px; }
  .ai3-chat-input { padding: 6px 8px; }
  .ai3-chat-input textarea { font-size: 16px !important; min-height: 44px; }
  /* 输入区瘦身：全局手机规则给 input/按钮都写了 44px 下限，勾选框也被撑高，
     这里压回去，把省下的高度全部让给上面的对话区。音量条是悬停交互，触屏用不上，直接收掉。 */
  .ai3-chat-bar { gap: 6px; row-gap: 4px; }
  .ai3-chat-bar .ai3-btn { min-height: 28px; padding: 3px 7px; font-size: 11.5px; }
  .ai3-tts { font-size: 11.5px; min-height: 0; }
  .ai3-tts input { min-height: 0 !important; padding: 0; }
  .ai3-vol { display: none !important; }
  .ai3-kb-row { font-size: 13px; flex-wrap: wrap; }
  .ai3-kb-row .tm { width: 72px; font-size: 11px; }
  .ai3-kb-row .s { width: 58px; font-size: 11px; }
  .ai3-parse-preview { height: 150px; }
  .ai3-side-tabs .ai3-tab { font-size: 12px; }

  /* 提示条：下移避开顶栏，别盖住汉堡按钮 */
  #toastBox { top: calc(58px + env(safe-area-inset-top)) !important; right: 10px !important; left: auto !important; max-width: 82vw; }

  /* 通讯录标题等固定大字号，收一档 */
  .ab-title { font-size: 20px; margin: 4px 0 10px; }

  /* ---------- 手机一张图：复刻桌面首页渠网大图 ----------
     卫星底图 + 红/绿发光流动主渠 + 泵站黄圆呼吸标注 + 总站蓝星 + 渠名文字 + 图例 */
  .m-gis {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100dvh - 138px);
    position: relative;
    overflow: hidden;
    background:
      radial-gradient(120% 80% at 50% 18%, rgba(34, 90, 140, .32), transparent 62%),
      linear-gradient(180deg, #0a1c33 0%, #071426 100%);
  }
  /* 整页一张图（底部 Tab 进入）：内容区去内边距、地图铺满到 Tab 栏上沿，页面不再留蓝底空白 */
  .content.m-gis-page,
  .layout:not(.home) .content.m-gis-page {
    padding: 0 !important;
    overflow: hidden !important;
  }
  /* 高度由 JS 按视口精确定位（贴顶栏、贴底部 Tab 栏），这里给兜底值 */
  .content.m-gis-page > .m-gis { position: fixed; left: 0; right: 0; height: 100%; }
  /* 视口 + 舞台：铺满模式下地图比屏幕大，单指拖动查看；「全图」模式等比居中 */
  .m-gis-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
  .m-gis-view.dragging { cursor: grabbing; }
  .m-gis-stage { position: relative; will-change: transform; }
  .m-gis-tools { position: absolute; right: 10px; top: 10px; z-index: 12; }
  .m-gis-btn {
    font-size: 12px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
    color: #bfe8ff; background: rgba(6, 20, 38, .72);
    border: 1px solid rgba(70, 202, 255, .45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  }
  .m-gis-btn:active { transform: scale(.96); }
  .m-gis-compact .m-gis-tools { display: none; }
  .m-gis::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
      linear-gradient(rgba(56, 189, 248, .05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(56, 189, 248, .05) 1px, transparent 1px);
    background-size: 28px 28px;
  }

  /* 首页卡片内嵌一张图：固定高度、去重边框，按容器宽高等比缩放 */
  .m-gis.m-gis-compact { height: 250px; }
  /* 首页「灌区一张图」卡片：高度由 JS 贴合页签框（页签等高拉齐后的实际高度），
     地图按该高度等比放大铺满，左右微裁 —— 卡片下方不再留一大块蓝底空白 */
  #paneGis { padding: 0; overflow: hidden; }
  #paneGis .m-gis.m-gis-compact { align-items: stretch; }
  .m-gis.m-gis-compact .m-gis-map { border: none; border-radius: 0; box-shadow: none; }
  /* 图例与桌面同一套七项两列，小图整体收一档，避免占掉半幅地图 */
  .m-gis.m-gis-compact .m-gis-legend { padding: 2px 4px; left: 4px; bottom: 4px; transform-origin: left bottom;
    max-width: 30%; line-height: 1.4; background: rgba(6, 17, 33, .42); border-radius: 4px;
    border-color: rgba(56, 189, 248, .18); backdrop-filter: blur(1px); }
  .m-gis.m-gis-compact .m-gis-legend .mlc-body { font-size: 6.5px; gap: 1px 5px; }
  .m-gis.m-gis-compact .m-gis-legend   .mlc-title { font-size: 7px; margin-bottom: 1px; padding-bottom: 0;
    line-height: 1.2; border-bottom-color: rgba(56,189,248,.14); }
  .m-gis.m-gis-compact .m-gis-legend .mlc-item { gap: 2px; padding: 0; }
  /* 图标尺寸统一按字号 1:1 收口：线 0.9em×0.25em、点 0.7em、星 1em */
  .m-gis.m-gis-compact .m-gis-legend .mlc-item i.ln { width: 6px; height: 1.5px; border-radius: 1px; }
  .m-gis.m-gis-compact .m-gis-legend .mlc-item i.pt { width: 4.5px; height: 4.5px; }
  .m-gis.m-gis-compact .m-gis-legend .mlc-item i.star5 { font-size: 6.5px; line-height: 1.3; text-shadow: 0 0 3px rgba(59, 130, 246, .85); }
  .m-gis-compact .m-gis-overlay { z-index: 8; }
  /* 卡片尺寸下按桌面字号等比缩放（桌面图宽约 850px，卡片约 370px，比例约 0.43），
     站名框、渠名文字、图标、偏移一起收，保持与电脑首页同一视觉比例 */
  .m-gis-compact .mg-mark .am-label { font-size: 7.5px; padding: 1.5px 4px; border-left-width: 2px; border-radius: 3px; letter-spacing: .2px; }
  .m-gis-compact .mg-mark.hub .am-label { font-size: 8.5px; }
  .m-gis-compact .mg-mark.text .am-label { font-size: 7px; letter-spacing: .5px; }
  .m-gis-compact .mg-mark.pump .am-icon { width: 9px; height: 9px; }
  .m-gis-compact .mg-mark.pump .am-icon i { width: 2.5px; height: 2.5px; }
  .m-gis-compact .mg-mark.pump .am-icon::after { width: 14px; height: 14px; }
  .m-gis-compact .mg-mark.hub .am-icon svg { width: 13px; height: 13px; }
  .m-gis-compact .mg-mark.pump .am-label { left: 7px; }
  .m-gis-compact .mg-mark.hub .am-label { left: 9px; }
  .m-gis-compact .mg-mark.label-left .am-label { right: 8px; }
  .m-gis-compact .mg-mark.label-bottom .am-label { top: 7px; }
  .m-gis-compact .mg-mark.label-up .am-label { top: -7px; }
  .m-gis-compact .mg-mark.label-down .am-label { top: 7px; }
  .m-gis-compact .mg-mark.label-up2 .am-label { top: -10px; }
  .m-gis-map {
    position: relative; z-index: 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(70, 202, 255, .36);
    background: #0b2444 url(../../data/pucheng_map_main.jpg) center/contain no-repeat;
    box-shadow: 0 0 0 1px rgba(8, 20, 38, .8), 0 10px 30px rgba(0, 0, 0, .55), inset 0 0 34px rgba(56, 189, 248, .08);
  }
  .m-gis-map svg { width: 100%; height: 100%; display: block; position: relative; z-index: 0; }
  .m-gis-map .basemap-tint { fill: #07182c; opacity: .34; display: block; pointer-events: none; }
  /* 手机画布窄（1000 逻辑单位压到 ~390px），主渠线宽按比例收一档，避免红绿发光线糊成色块 */
  .m-gis-map .fx-casing { stroke-width: 8.5; }
  .m-gis-map .fx-halo { stroke-width: 6.5; }
  .m-gis-map .fx-dash { stroke-width: 3.4;
    /* 手机画布窄、整图缩到 ~0.36 倍，桌面 11/7 虚线在屏幕上只剩 4px 段、糊成实线；
       按屏幕比例定为 16 段 + 20 空隙（周期 36，屏幕约 5.7px 段 / 7.1px 隙），
       段短一点、间距放宽，点划线感明显又不发糊 */
    stroke-dasharray: 16 20; animation: mChanFlow 3.2s linear infinite; }
  /* 卡片内主渠改用 CSS 发光，避开 iPhone Safari 对 SVG 滤镜的渲染 bug（会出现黑色块） */
  @keyframes mChanFlow { to { stroke-dashoffset: -36; } }
  .m-gis-compact .fx-dash-red { filter: drop-shadow(0 0 2px rgba(255,95,95,.85)); }
  .m-gis-compact .fx-dash-green { filter: drop-shadow(0 0 2px rgba(61,220,132,.85)); }
  .m-gis-overlay { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: visible; }

  /* 站点标记：0×0 锚点压在逻辑点上，图标与站名一体跟随 */
  .mg-mark { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: auto; user-select: none; }
  .mg-mark .am-icon { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; }
  /* 蒲城总站：蓝色实心五角星 + 描影 */
  .mg-mark.hub .am-icon svg { display: block; width: 22px; height: 22px;
    filter: drop-shadow(0 0 4px rgba(37, 99, 235, .85)) drop-shadow(0 1px 2px rgba(0, 0, 0, .75)); }
  /* 泵站：亮黄圆点 + 深色外圈 + 金色光晕 */
  .mg-mark.pump .am-icon { width: 15px; height: 15px; border-radius: 50%;
    background: rgba(234, 179, 8, .45); border: 2px solid #fbbf24;
    box-shadow: 0 0 0 1.5px rgba(4, 16, 32, .72), 0 0 8px rgba(251, 191, 36, .55); }
  .mg-mark.pump .am-icon i { width: 5px; height: 5px; border-radius: 50%; background: #fde047; }
  /* 泵站外发光呼吸脉冲（动画关键帧复用全局 annotGlowPulse） */
  .mg-mark .am-icon::after {
    content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%;
    transform: translate(-50%, -50%); pointer-events: none; z-index: -1;
    animation: annotGlowPulse 1.8s ease-in-out infinite;
  }
  .mg-mark.hub .am-icon::after { content: none; }
  .mg-mark.pump .am-icon::after {
    width: 22px; height: 22px;
    background: radial-gradient(circle, rgba(253, 224, 71, .55) 0%, rgba(251, 191, 36, .22) 48%, rgba(251, 191, 36, 0) 72%);
  }
  /* 站名标签：深色底板 + 文字描影 + 左侧色条 */
  .mg-mark .am-label {
    position: absolute; top: 0; transform: translateY(-50%);
    font-size: 11px; line-height: 1.15; color: #fff; white-space: nowrap; font-weight: 600;
    background: rgba(3, 12, 26, .88); border: 1px solid rgba(120, 200, 255, .5);
    border-left: 3px solid #7fd1ff; border-radius: 5px; padding: 3px 7px; letter-spacing: .2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .85); box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  }
  .mg-mark.pump .am-label { left: 10px; border-color: rgba(251, 191, 36, .55); border-left-color: #fbbf24; color: #fff7d6; }
  .mg-mark.hub .am-label { left: 13px; color: #ffe9a8; border-color: #fbbf24; border-left-color: #fbbf24; font-weight: 700; font-size: 12px; }
  .mg-mark.label-left .am-label { left: auto; right: 12px; top: 10px; transform: translate(-100%, 0); border-left: none; border-right: 3px solid #fbbf24; }
  .mg-mark.label-bottom .am-label { left: 50%; top: 12px; transform: translateX(-50%); border-left: none; border-right: none; border-top: 3px solid #fbbf24; }
  .mg-mark.label-up .am-label { top: -12px; }
  .mg-mark.label-down .am-label { top: 12px; }
  .mg-mark.label-up2 .am-label { top: -18px; }
  /* 纯文字渠名：无底板，四色与图例渠色一致 */
  .mg-mark.text .am-label {
    left: 6px; padding: 1px 4px; background: transparent; border: none; box-shadow: none;
    color: #fde047; font-weight: 700; font-size: 10px; letter-spacing: .3px;
    text-shadow: 0 0 4px rgba(0, 0, 0, .95), 0 1px 3px rgba(0, 0, 0, .95);
  }
  .mg-mark.label-left.text .am-label { left: auto; right: 6px; border-right: none; }
  .mg-mark.text.text-red .am-label { color: #ef4444; }
  .mg-mark.text.text-green .am-label { color: #22c55e; }
  .mg-mark.text.text-cyan .am-label { color: #22d3ee; }

  /* 左下角图例卡片 */
  .m-gis-legend {
    position: absolute; left: 8px; bottom: 8px; z-index: 2;
    background: rgba(6, 17, 33, .66); border: 1px solid rgba(56, 189, 248, .26);
    border-radius: 8px; padding: 6px 8px; backdrop-filter: blur(4px); max-width: 58%;
  }
  /* 整页模式图例挪到右下角（抬到底部 Tab 栏之上），不压蒲城总站一带的站点标注 */
  .m-gis:not(.m-gis-compact) .m-gis-legend {
    left: auto; right: 10px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    max-width: 52%;
  }
  .m-gis-legend .mlc-title { font-weight: 700; color: #7fd1ff; margin-bottom: 3px;
    border-bottom: 1px solid rgba(56, 189, 248, .2); padding-bottom: 2px; font-size: 11px; text-align: center; }
  .m-gis-legend .mlc-body { display: grid; grid-template-columns: repeat(2, auto); gap: 2px 10px;
    color: #7fa3c4; font-size: 10px; align-items: center; }
  .m-gis-legend .mlc-item { display: flex; align-items: center; gap: 5px; padding: 1px 0; color: #d7e6f5; white-space: nowrap; }
  .m-gis-legend .mlc-item i { flex: none; display: inline-block; }
  .m-gis-legend .mlc-item i.ln { width: 18px; height: 4px; border-radius: 2px; }
  .m-gis-legend .mlc-item i.pt { width: 10px; height: 10px; border-radius: 50%; }
  .m-gis-legend .mlc-item i.star5 { width: auto; height: auto; background: none; box-shadow: none;
    color: #3b82f6; font-size: 14px; line-height: 1; font-style: normal;
    text-shadow: 0 0 6px rgba(59, 130, 246, .95); }
}


/* 手机极窄屏（iPhone SE / mini）再收一档 */
@media (max-width: 370px) {
  .m-grid { grid-template-columns: repeat(4, 1fr); }
  .topbar #irrYearSel, .topbar #irrYearBtn { width: 78px; min-width: 78px; font-size: 11px; }
  .topbar #irrSeasonSel { width: 62px; min-width: 62px; font-size: 11px; }
  .m-hero .m-clock { font-size: 16px; }
  .m-hero { gap: 8px; padding: 12px 12px 10px; }
  .m-ring { width: 108px; height: 108px; }
  .mb-grid { grid-template-columns: 1fr; }
}

/* 手机横屏：Tab 条收窄，内容更宽 */
@media (max-height: 500px) and (orientation: landscape) {
  .m-tabbar { height: 46px; }
  .m-tabbar .m-tab { flex-direction: row; gap: 6px; font-size: 12px; }
  .content { padding-bottom: calc(56px + env(safe-area-inset-bottom)) !important; }
  .m-hero { padding: 12px; }
  .m-hero .m-clock { font-size: 18px; }
}

/* 桌面端默认隐藏移动专属元素（不受媒体查询影响，双保险） */
.m-burger, .m-tabbar, .m-drawer-mask, .m-drawer-foot { display: none; }
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) {
  .m-burger { display: flex; }
  .m-tabbar { display: flex; }
  .m-drawer-mask { display: block; }
  .m-drawer-foot { display: flex; }
}

/* ---------- 2026-11-19 修复：底部悬浮元素避让 Tab 栏 ----------
   桌面样式里 #musicCard 写死 left:254px / bottom:24px，.hf-capsule 写死 bottom:24px，
   手机上正好压在 58px 高的底部 Tab 上（遮住「智能体」Tab，还盖住抽屉里的「退出登录」）。
   这里只在手机尺寸把它们抬到 Tab 栏之上、改到右侧，桌面端完全不受影响。 */
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) {
  /* 2026-11-23 按用户要求：
     (1)「小度」AI 胶囊（智能体胶囊）手机端一律不出现，避免与底部 Tab / 音乐胶囊重叠；
     (2)「我的音乐」胶囊从原来左下角（压住「快捷业务」页签）挪到右下角 —— 即原 AI 胶囊那格，
         正好落在页签行右侧空白处，不压「快捷业务 / 今日值班」任何文字。
     left/right/top/bottom 四项全部 !important，压掉 JS 拖拽写入的 inline left/top，
     手机端位置固定，桌面端拖拽记忆完全不受影响。 */
  /* 2026-11-23（用户二次调整）：
     (1)「小度」AI 胶囊恢复浮现，回到右下角、抬到 Tab 栏之上；
     (2)「我的音乐」胶囊平时不在首页浮现 —— 入口收进「快捷业务」九宫格，
         点磁贴才临时露出歌单面板（宿主加 .my-force-show，圆钮本身仍不显示）。 */
  #musicCard {
    display: none !important;
    left: auto !important;
    right: 12px !important;
    top: auto !important;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    max-width: calc(100vw - 28px);
  }
  #musicCard.my-force-show { display: block !important; }
  /* 从宫格唤出时只露面板，不露那个圆钮（否则等于又把胶囊浮出来了） */
  #musicCard.my-force-show .my-pill { display: none !important; }
  /* 面板按屏宽收口并贴右下，390 屏也不会冲出屏幕 */
  #musicCard .my-panel {
    left: auto !important; right: 0 !important; bottom: 0 !important;
    width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 210px) !important;
  }
  /* 右下角「小度」AI 胶囊：抬到 Tab 栏之上，与页签行错开 */
  .hf-capsule {
    bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    right: 14px !important;
  }
}

/* 三期手机设置中心（mod_mobile_settings.js） */
.m-set{padding:4px 0 80px}
.m-set-head{display:flex;align-items:center;gap:10px;padding:10px 2px 14px}
.m-set-avatar{width:42px;height:42px;border-radius:12px;background:linear-gradient(145deg,#0c4d7a,#0a2e52);border:1px solid rgba(70,202,255,.45);color:#46caff;display:flex;align-items:center;justify-content:center;font-weight:800}
.m-set-head b{display:block;color:#e8f4ff;font-size:16px}
.m-set-head span{display:block;color:#6f8bb0;font-size:11px;margin-top:2px}
.m-set-card{background:rgba(9,31,56,.78);border:1px solid rgba(48,108,160,.35);border-radius:12px;padding:12px;margin:10px 0}
.m-set-card h3{margin:0 0 8px;color:#bfe3ff;font-size:14px;display:flex;align-items:center;gap:6px}
.m-set-card h3::before{content:'';width:3px;height:13px;border-radius:2px;background:#46caff;box-shadow:0 0 8px rgba(70,202,255,.5)}
.m-set-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 0;border-bottom:1px dashed rgba(70,120,160,.2);font-size:12px;color:#9fc3e0}
.m-set-row:last-child{border-bottom:0}
.m-set-row label{color:#9fc3e0}
.m-set-row b{color:#e8f4ff;font-weight:600;max-width:60%;text-align:right}
.m-set-row input[type=checkbox]{width:18px;height:18px;accent-color:#2fc0e8}
.m-set-row select,.m-set-row input[type=text],.m-set-row input:not([type]){background:#071c33;border:1px solid rgba(70,130,180,.45);color:#d9ecff;border-radius:7px;padding:5px 8px;font-size:12px}
.m-set-row input[type=range]{flex:1;accent-color:#2fc0e8}
.m-set-checks{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:5px 0 9px}
.m-set-checks label{display:flex;align-items:center;gap:5px;font-size:12px;color:#9fc3e0;background:rgba(47,192,232,.06);border:1px solid rgba(47,192,232,.16);border-radius:8px;padding:7px 6px}
.m-set-checks input{accent-color:#2fc0e8}
.m-set-save{width:100%;margin-top:9px;padding:9px;border-radius:9px;border:1px solid rgba(47,192,232,.45);background:linear-gradient(180deg,rgba(47,192,232,.22),rgba(20,90,140,.25));color:#c8edff;font-weight:700;font-size:13px}
.m-set-list{margin-top:7px}
.m-set-dev{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px dashed rgba(70,120,160,.18)}
.m-set-dev b{display:block;color:#d9ecff;font-size:12px}
.m-set-dev span{display:block;color:#6f8bb0;font-size:10px;margin-top:2px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-set-tag{font-size:10px;color:#7da3c4;border:1px solid rgba(120,160,200,.3);padding:2px 6px;border-radius:8px}
.m-set-tag.on{color:#46caff;border-color:rgba(70,202,255,.45)}
.m-set-mini{font-size:11px;color:#ff9b9b;background:transparent;border:1px solid rgba(255,120,120,.35);border-radius:7px;padding:4px 8px}
