/* ============================================================
   旅行管家 · 手机端壳（html.mphone 命中时接管整屏）
   目标设备：iPhone 15 Pro Max(≈430css, 刘海/Home条) 与 小米 Mix Fold 3(外屏≈360 / 内屏宽到~1000 css、折开会实时变化)
   思路：#mRoot 固定整屏 flex 竖排；桌面 header/main 在 mphone 时整体隐藏。
   共享桌面 engine 的 :root 主题变量（品牌色/明暗），只补充手机专属布局。
   ============================================================ */
html.mphone body{overflow:hidden}
html.mphone header.top, html.mphone main, html.mphone #modalRoot{display:none!important}

#mRoot{display:none}
html.mphone #mRoot{
  display:flex; flex-direction:column;
  position:fixed; inset:0; z-index:80;
  background:var(--bg); color:var(--ink);
  -webkit-text-size-adjust:100%; text-size-adjust:100%;
  font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
}
html.mphone #mRoot button{font:inherit}
html.mphone #mRoot input,html.mphone #mRoot select,html.mphone #mRoot textarea{
  font:inherit; color:var(--ink); background:var(--card);
  border:1px solid var(--line-2); border-radius:11px; padding:11px 12px;
  outline:none; font-size:16px; /* ≥16px 避免 iOS 聚焦自动放大 */
  width:100%; box-sizing:border-box;
}
html.mphone #mRoot input:focus,html.mphone #mRoot select:focus,html.mphone #mRoot textarea:focus{
  border-color:var(--brand); box-shadow:0 0 0 3px rgba(194,65,12,.16);
}
html[data-theme="dark"] html.mphone #mRoot input:focus{box-shadow:0 0 0 3px rgba(232,106,52,.25)}

/* 顶部 app 栏 */
.mhead{
  flex:none; display:flex; align-items:center; gap:8px;
  padding:calc(env(safe-area-inset-top,0px) + 8px) 14px 8px;
  background:var(--bg); border-bottom:1px solid var(--line);
}
.mhead .mbrd{flex:1; min-width:0; line-height:1.25}
.mhead .mbrd b{display:block; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.mhead .mbrd span{display:block; font-size:12px; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.mhead button{
  flex:none; width:38px; height:38px; border-radius:11px; border:1px solid var(--line);
  background:var(--card); font-size:17px; display:grid; place-items:center; color:var(--ink-2);
}
.mhead button:active{transform:scale(.94)}
.mhead button.on{color:var(--brand); border-color:var(--brand)}

/* 滚动内容区 */
#mScr{flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; background:var(--bg)}

/* 下拉刷新指示器：头栏与列表之间真实 flex 子项，平时 0 高隐藏；下拉把它
   顶开时列表(#mScr flex:1)自动被往下挤。视觉 = 列表顶浮出一枚小胶囊（白卡片
   + 转圈箭头 + 短文案），不再是占满全宽的灰色文字条。完成/失败只显示在胶囊里，
   不弹底部 toast。 */
#mPtr{
  flex:none; height:0; overflow:hidden; background:transparent;
  display:flex; align-items:flex-start; justify-content:center;
  pointer-events:none;                     /* 胶囊不拦触摸，全落在 #mScr */
  transition:height .24s cubic-bezier(.2,.7,.3,1);
}
#mPtr .mPtrChip{
  display:flex; align-items:center; gap:8px; margin-top:9px;
  padding:7px 15px 7px 8px; border-radius:999px; box-sizing:border-box;
  background:var(--card); border:1px solid var(--line);
  box-shadow:0 3px 12px rgba(30,16,8,.10);
  color:var(--ink-2); font-size:12.5px; font-weight:600; letter-spacing:.2px;
  white-space:nowrap;
}
#mPtr .mPtrTxt{line-height:1}
#mPtr .mPtrRing{flex:none; width:20px; height:20px; transform:rotate(var(--rot,0deg))}
#mPtr .mPtrRing circle{fill:none; stroke-width:3}
#mPtr .mPtrRing .mPtrBg{stroke:var(--line-2)}
#mPtr .mPtrRing .mPtrArc{stroke:var(--ink-3); stroke-linecap:round; stroke-dasharray:60.7 30.4}
#mPtr[data-st="release"] .mPtrRing .mPtrArc,
#mPtr[data-st="sync"] .mPtrRing .mPtrArc{stroke:var(--brand)}
#mPtr[data-st="sync"] .mPtrRing{animation:mPtrSpin .7s linear infinite}
#mPtr[data-st="ok"] .mPtrRing,#mPtr[data-st="err"] .mPtrRing{opacity:0}
#mPtr[data-st="ok"] .mPtrTxt{color:var(--good, #1e8e4e)}
#mPtr[data-st="err"] .mPtrTxt{color:var(--bad)}
@keyframes mPtrSpin{to{transform:rotate(360deg)}}
/* 手机端时间一律走自选 24 小时弹层（.timebox→#mTp）：出发卡 / 固定到达·离开（2026-09-05） */
.mwakerow{display:flex; align-items:center; gap:8px; margin:0}
.timebox{
  flex:1; min-width:0; text-align:center; font-variant-numeric:tabular-nums;
  font-size:17px; font-weight:800; letter-spacing:1px; padding:11px 6px; border-radius:12px;
  border:1px solid var(--line-2); background:var(--card); color:var(--ink);
}
.timebox.set{border-color:var(--brand); color:var(--brand)}
.timebox:active{transform:scale(.98)}
.mwakedef{flex:none; padding:8px 11px; font-size:12.5px; font-weight:600; line-height:1;
  border-radius:10px; border:1px solid var(--line); background:var(--card); color:var(--brand)}
.mwakedef:active{transform:scale(.96)}
.mwrap{max-width:640px; margin:0 auto; padding:12px 14px 20px; box-sizing:border-box}
html.mphone #mRoot ::-webkit-scrollbar{width:0;height:0}

/* 底部导航 */
.mtabbar{
  flex:none; display:flex; background:var(--card);
  border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.mtabbar button{
  flex:1; border:0; background:transparent; color:var(--ink-3);
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:7px 0 8px; font-size:11px; font-weight:600; min-height:50px;
}
.mtabbar button i{font-style:normal; font-size:21px; line-height:1}
.mtabbar button.on{color:var(--brand)}
html[data-theme="dark"] .mtabbar button.on{color:var(--brand)}

/* 通用小件 */
.mcard{background:var(--card); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); margin:10px 0}
.mcard>.pad{padding:14px 14px 16px}
.mcard .mtl{font-size:14px; font-weight:700; margin:0 0 2px}
.mcard .msub{font-size:12px; color:var(--ink-3); line-height:1.5}
.mrow{display:flex; align-items:center; gap:10px}
/* 桌面菜单编辑器有个窄屏 @media 把 .mrow 改成 5 列 grid（手机宽也会命中）→
   手机端必须用更高特异度钉死 flex，否则 记账 日期/备注 输入框只按内容宽 84px、显示不全(2026-09-05) */
html.mphone #mRoot .mrow{display:flex; align-items:center; gap:10px}
.mtag{font-size:12px; color:var(--ink-3)}
.mbtn{
  border:1px solid var(--line-2); background:var(--card); color:var(--ink);
  border-radius:11px; padding:9px 14px; font-size:14px; font-weight:600; text-align:center;
}
.mbtn.primary{background:var(--brand); color:var(--on-brand); border-color:var(--brand)}
.mbtn.big{padding:13px; font-size:16px; border-radius:14px}
.mbtn.ghost{background:transparent; color:var(--brand-ink)}
.mbtn:active{transform:scale(.98)}

/* 第几天胶囊 */
.mdays{display:flex; gap:8px; overflow-x:auto; padding:2px 0 4px}
.mpill{
  flex:none; display:flex; align-items:center; gap:6px; padding:7px 13px;
  border:1px solid var(--line-2); background:var(--card); color:var(--ink-2);
  border-radius:999px; font-size:13.5px; font-weight:600; white-space:nowrap;
}
.mpill i.dot{width:10px; height:10px; border-radius:50%; flex:none}
.mpill.on{background:var(--brand); color:var(--on-brand); border-color:var(--brand)}
.mpill small{font-weight:600; opacity:.85; font-size:11px}

.mdayttl{display:flex; align-items:baseline; gap:8px; margin:2px 2px 0}
.mdayttl b{font-size:18px}
.mdayttl span{font-size:12.5px; color:var(--ink-3)}
.mdaymeta{display:flex; gap:10px; flex-wrap:wrap; font-size:12.5px; color:var(--ink-2); margin:6px 2px 2px}
.mdaymeta .ck{color:var(--good); font-weight:700}

/* 时段线清单 */
.mtlst{position:relative; padding:0 0 2px 2px}
.mstat{
  display:flex; gap:11px; align-items:flex-start; background:var(--card);
  border:1px solid var(--line); border-radius:15px; padding:11px 12px;
  margin:9px 0; box-shadow:var(--shadow);
}
.mstat .rail{
  flex:none; width:38px; height:38px; border-radius:12px; display:grid; place-items:center;
  font-size:18px; position:relative;
}
.mstat.done{opacity:.85}
/* 打勾指示只留行右侧那个小圆圈(下面 .mchk.on)；emoji 块不再盖绿也不加 ✓ 角标 */
.mstat.done .rail{filter:grayscale(.35); opacity:.75}
.mstat .mtx{flex:1; min-width:0}
.mstat .mtx b{display:block; font-size:15px; line-height:1.35; word-break:break-all}
.mstat.done .mtx b{color:var(--ink-3); text-decoration:line-through}
.mstat .mtx .l2{display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:3px}
.mstat .mtx .tt{font-size:12.5px; color:var(--ink-2); font-variant-numeric:tabular-nums}
.mstat .mtx .tt .over{color:var(--bad); font-weight:700}
.mstat .mtx .nt{margin-top:4px; font-size:12px; color:var(--ink-3); line-height:1.5; word-break:break-word}
.mstat .mtx .l2 .meal{font-size:11px; padding:1px 7px; border-radius:999px; background:var(--card-2); color:var(--ink-2); font-weight:600}
.mstat .mtime{flex:none; text-align:right; font-size:12px; color:var(--ink-2); line-height:1.7; font-variant-numeric:tabular-nums; padding-top:1px}
.mstat .mtime .ov{color:var(--bad); font-weight:700}
/* 每行右侧的「去过」小圆圈：直接点它打勾/取消，不弹详情 */
.mstat .mchk{
  flex:none; width:25px; height:25px; border-radius:50%; align-self:center; margin-left:9px;
  border:2px solid var(--line-2); background:transparent; color:var(--ink-3);
  font-size:13px; font-weight:800; line-height:1; display:grid; place-items:center; padding:0;
}
.mstat .mchk.on{border-color:var(--good); background:var(--good); color:#fff}
.mstat .mchk:active{transform:scale(.9)}

.mleg{
  display:flex; align-items:center; gap:6px; margin:2px 2px 0 30px;
  color:var(--ink-3); font-size:12px; line-height:1;
}
.mleg .lgline{flex:1; height:1px; background:var(--line-2); min-width:12px}
.mempty{text-align:center; color:var(--ink-3); font-size:13.5px; padding:34px 8px; line-height:2}

/* 底部弹层 */
#mSh{position:fixed; inset:0; z-index:95; display:none; align-items:flex-end; justify-content:center; background:rgba(15,12,6,.38)}
#mSh.open{display:flex}
#mSh .shcard{
  width:100%; max-width:640px; max-height:88%; overflow-y:auto;
  background:var(--card); border-radius:20px 20px 0 0; padding:10px 0 calc(env(safe-area-inset-bottom,0px) + 16px);
  box-shadow:0 -8px 30px rgba(0,0,0,.18);
}
#mSh .shcard>.shbody{padding:0 18px}
.shgrab{width:42px; height:5px; border-radius:3px; background:var(--line-2); margin:4px auto 6px}
.shhead{display:flex; align-items:flex-start; gap:10px; padding:6px 18px 12px; border-bottom:1px solid var(--line)}
.shhead .t{flex:1; min-width:0}
.shhead .t b{display:block; font-size:18px; line-height:1.35}
.shhead .t span{font-size:12.5px; color:var(--ink-3)}
.shhead button{flex:none; width:34px; height:34px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink-2); font-size:15px}
.shline{display:flex; align-items:center; gap:8px; padding:11px 2px; border-bottom:1px solid var(--line); font-size:14px}
.shline .k{flex:none; width:62px; color:var(--ink-3); font-size:12.5px}
.shline .v{flex:1; min-width:0; word-break:break-word}
.shtitle{font-size:13px; font-weight:700; color:var(--ink-2); margin:16px 2px 4px}
.shactions{display:flex; gap:10px; padding:14px 2px 2px; flex-wrap:wrap}
.shactions .mbtn{flex:1; min-width:120px}
/* 固定到达/离开 双钟点：到达、离开各占一行，行尾各带「清除」(2026-09-05) */
.ovrow{display:flex; align-items:center; gap:10px; margin-top:9px}
.ovrow .timebox{flex:1}
.ovrow .ovclr{
  flex:none; border:0; background:transparent; color:var(--ink-3);
  font-size:12px; padding:8px 2px; font-weight:600;
}
.ovrow .ovclr:active{color:var(--bad)}

/* 24 小时制时间自选弹层（时/分两列，手动点选，确定键两列都选了才可用）(2026-09-05) */
#mTp,#mNav{position:fixed; inset:0; z-index:120; display:flex; align-items:flex-end; justify-content:center; background:rgba(15,12,6,.5)}
#mTp .tpcard,#mNav .tpcard{
  width:100%; max-width:640px; background:var(--card);
  border-radius:20px 20px 0 0; padding:8px 16px calc(env(safe-area-inset-bottom,0px) + 18px);
  box-shadow:0 -8px 30px rgba(0,0,0,.2); animation:mTpUp .18s ease-out;
}
@keyframes mTpUp{from{transform:translateY(26px); opacity:.5}to{transform:none; opacity:1}}
#mTp .tptitle,#mNav .tptitle{display:flex; align-items:center; gap:8px; font-size:16px; font-weight:800; padding:6px 2px 0}
#mTp .tpclose,#mNav .tpclose{margin-left:auto; width:34px; height:34px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink-2); font-size:15px}
#mTp .tpdisp{text-align:center; font-size:46px; font-weight:800; font-variant-numeric:tabular-nums; letter-spacing:3px; margin:10px 0 0}
#mTp .tpdisp.none{color:var(--ink-3)}
#mTp .tpcols{display:flex; gap:12px; margin-top:12px}
#mTp .tpcol{flex:1; min-width:0; background:var(--bg); border:1px solid var(--line); border-radius:14px; overflow:hidden}
#mTp .tpcolhead{text-align:center; font-size:12.5px; color:var(--ink-3); font-weight:700; padding:8px 0 6px; border-bottom:1px solid var(--line); background:var(--card)}
#mTp .tpbody{height:248px; overflow-y:auto; -webkit-overflow-scrolling:touch; scroll-behavior:smooth; overscroll-behavior:contain}
#mTp .tpcell{
  text-align:center; padding:12px 0; font-size:19px; font-weight:700; cursor:pointer;
  font-variant-numeric:tabular-nums; color:var(--ink-2); border-bottom:1px solid transparent;
}
#mTp .tpcell.sel{background:var(--brand); color:var(--on-brand); font-weight:800}
#mTp .tpcell:active{background:var(--line-2)}
#mTp .tpack{display:flex; gap:10px; margin-top:14px}
#mTp .tpack .mbtn{flex:1; padding:13px; font-size:15px}
#mTp .mbtn.dim{opacity:.4; pointer-events:none}

/* 高德去这里：选交通方式（不直开驾车导航，2026-09-05） */
#mNav .tpcard{background:var(--card)}
#mNav .tpcard .msub{font-size:12.5px; color:var(--ink-3); line-height:1.6}
.navrow{
  display:flex; align-items:center; gap:12px; width:100%; margin-top:10px;
  padding:12px 13px; text-align:left; border-radius:14px;
}
.navrow .ni{flex:none; width:34px; font-size:21px; line-height:1; text-align:center}
.navrow .nt{flex:1; min-width:0}
.navrow .nt b{display:block; font-size:15px; line-height:1.3}
.navrow .nt i{display:block; font-style:normal; font-size:12px; color:var(--ink-3); margin-top:2px; font-weight:500}
.navrow .na{flex:none; color:var(--brand); font-size:13px; font-weight:800}

/* 记账 */
.mkpi{display:flex; align-items:center; gap:6px; margin:0 2px}
.mkpi .amt{font-size:30px; font-weight:800; font-variant-numeric:tabular-nums; line-height:1.1}
.mkpi .amt small{font-size:15px; color:var(--ink-3); font-weight:600}
.mkpi .lb{font-size:12px; color:var(--ink-3)}
.mmeter{height:10px; border-radius:5px; background:var(--card-2); overflow:hidden; margin-top:9px}
.mmeter i{display:block; height:100%; border-radius:5px; background:var(--good)}
.mmeter i.ok{background:var(--good)} .mmeter i.warn{background:var(--warn)}
.mmeter i.low{background:var(--bad)} .mmeter i.over{background:var(--bad); width:100%!important}
.mseg{display:flex; gap:4px; background:var(--card-2); border-radius:11px; padding:3px; margin:10px 0 4px}
.mseg button{flex:1; border:0; background:transparent; padding:8px; border-radius:9px; color:var(--ink-2); font-weight:600; font-size:13px}
.mseg button.on{background:var(--card); color:var(--ink); box-shadow:var(--shadow)}
.mcatrow{display:flex; align-items:center; gap:8px; padding:9px 4px; border-bottom:1px solid var(--line); font-size:13.5px}
.mcatrow .sw{width:10px; height:10px; border-radius:3px; flex:none}
.mcatrow .cn{flex:none; font-weight:600}
.mcatrow .bar{flex:1; height:8px; border-radius:4px; background:var(--card-2); overflow:hidden}
.mcatrow .bar i{display:block; height:100%}
.mcatrow .st{font-size:11.5px; color:var(--ink-3); font-variant-numeric:tabular-nums}
.mxline{display:flex; align-items:center; gap:8px; padding:10px 2px; border-bottom:1px solid var(--line); font-size:14px}
.mxline .dt{flex:none; font-size:11.5px; color:var(--ink-3); width:38px}
.mxline .chip{flex:none; font-size:11px; padding:2px 8px; border-radius:999px; color:#fff; font-weight:600; max-width:74px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.mxline .nt{flex:1; min-width:0; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.mxline .amt{flex:none; font-weight:700; font-variant-numeric:tabular-nums}
.mxline .del{flex:none; border:0; background:transparent; color:var(--ink-3); font-size:14px; padding:4px 2px}
.mamtline{display:flex; align-items:center; gap:8px}
.mamtline input{font-size:30px!important; font-weight:800; text-align:right; border:none!important; background:transparent!important; box-shadow:none!important; padding:4px 2px!important; font-variant-numeric:tabular-nums}
.mamtline .cur{font-size:24px; font-weight:800; color:var(--ink-3)}
/* 记一笔 日期/备注：输入框占满行尾、可收缩不溢出(2026-09-05 用户“日期显示不完全/备注一起延长”) */
.mxinput{flex:1 1 0%; min-width:0; max-width:100%; box-sizing:border-box}
.mchiprow{display:flex; gap:8px; flex-wrap:wrap; margin:6px 0}
.mchiprow button{border:1px solid var(--line-2); background:var(--card); padding:7px 12px; border-radius:999px; font-size:13px; color:var(--ink-2)}
.mchiprow button.on{background:var(--brand); color:var(--on-brand); border-color:var(--brand); font-weight:700}

/* 更多/清单/攻略 */
.mgrp{font-size:13px; color:var(--ink); padding:9px 0; border-bottom:1px solid var(--line)}
.mgrp:last-child{border-bottom:0}
.mgrp .gh{display:flex; align-items:center; gap:8px; font-weight:700}
.mgrp .gb{height:6px; border-radius:3px; background:var(--card-2); overflow:hidden; margin:6px 0 2px}
.mgrp .gb i{display:block; height:100%; background:var(--good)}
.mgrp .gi{display:flex; gap:8px; align-items:flex-start; padding:5px 0; font-size:13.5px; line-height:1.45}
.mgrp .gi .cb{flex:none; width:18px; height:18px; border-radius:6px; border:1px solid var(--line-2); margin-top:1px; display:grid; place-items:center; font-size:12px; color:#fff}
.mgrp .gi.on .cb{background:var(--good); border-color:var(--good)}
.mgrp .gi.on span{color:var(--ink-3); text-decoration:line-through}
.mgrp .gi[data-m="chk-item"]{cursor:pointer; border-radius:8px; margin:0 -4px; padding:5px 4px}
.mgrp .gi[data-m="chk-item"]:active{background:var(--card-2)}
.mnotecard{display:block; padding:10px 2px; border-bottom:1px solid var(--line)}
.mnotecard:last-child{border-bottom:0}
.mnotecard summary{display:flex; gap:10px; align-items:flex-start; cursor:pointer; list-style:none}
.mnotecard summary::-webkit-details-marker{display:none}
.mnotecard summary .thumb{flex:none; width:52px; height:52px; border-radius:11px; object-fit:cover; background:var(--card-2)}
.mnotecard summary .tb{flex:1; min-width:0}
.mnotecard summary .tb b{display:block; font-size:14px; line-height:1.35}
.mnotecard summary .tb p{font-size:12.5px; color:var(--ink-2); margin:3px 0 0; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
.mnotecard .full{font-size:13px; line-height:1.7; white-space:pre-wrap; color:var(--ink-2); padding:8px 2px 2px}
.mnotecard .full .lnk a{color:var(--brand-ink); word-break:break-all; font-size:13px}
.mtagchip{font-size:11px; padding:1px 8px; border-radius:999px; background:var(--card-2); color:var(--ink-2)}
.mlinkrow a{color:var(--brand-ink); word-break:break-all; font-size:13px}
.mempty2{color:var(--ink-3); font-size:13px; text-align:center; padding:16px 0}
.mtbl{width:100%; border-collapse:collapse}
.mtbl td{font-size:13.5px; padding:5px 0}
.mtbl td:first-child{color:var(--ink-3); width:76px; white-space:nowrap}
