/* ===========================================================
   M 端通用样式（移动优先 · 品牌渐变 #00bde9 → #7ed957）
   仅服务手机竖屏（桌面访问已被 common.php 跳回 PC 版），
   不依赖媒体查询兼容桌面。
   =========================================================== */
:root {
  --m-primary: var(--brand-500, #00bde9);
  --m-primary-d: var(--brand-600, #0098b8);
  --m-green: var(--brand-green, #7ed957);
  --m-gradient: var(--brand-gradient, linear-gradient(135deg, #00bde9 0%, #7ed957 100%));
  --m-gradient-soft: var(--brand-gradient-soft, linear-gradient(135deg, rgba(0,189,233,.12) 0%, rgba(126,217,87,.12) 100%));
  --m-bg: var(--surface-2, #f5f7fa);
  --m-card: var(--surface, #ffffff);
  --m-text: var(--text-1, #1c1c1e);
  --m-text-2: var(--text-2, #8e8e93);
  --m-line: var(--line, #eef0f3);
  --m-radius: var(--r-lg, 16px);
  --m-topbar-h: 52px;
  --m-nav-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body.m-app {
  font-family: PingFang SC, -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--m-text);
  background: var(--m-bg);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 顶部栏 ---------- */
.m-topbar {
  position: sticky; top: 0; z-index: 50;
  height: calc(var(--m-topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--m-line);
}
.m-topbar-inner {
  height: var(--m-topbar-h);
  display: flex; align-items: center; padding: 0 12px; gap: 8px;
}
.m-topbar-back, .m-topbar-back--ph { width: 32px; height: 32px; flex: 0 0 32px; display: flex; align-items: center; justify-content: center; }
.m-topbar-back { color: var(--m-text); font-size: 22px; border-radius: 50%; }
.m-topbar-back:active { background: var(--m-line); }
.m-topbar-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.m-topbar-right { width: 32px; flex: 0 0 32px; display: flex; align-items: center; justify-content: flex-end; font-size: 13px; color: var(--m-primary); }

/* ---------- 内容区 ---------- */
.m-main { padding: 12px; min-height: calc(100vh - var(--m-topbar-h) - var(--m-nav-h) - env(safe-area-inset-top,0px)); }
.m-foot-pad { height: calc(var(--m-nav-h) + env(safe-area-inset-bottom, 0px) + 16px); }
.m-card {
  background: var(--m-card); border-radius: var(--m-radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.04); margin-bottom: 12px; overflow: hidden;
  animation: mFade .35s ease both;
}
@keyframes mFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.m-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px; font-size: 15px; font-weight: 600;
}
.m-card-head span:first-child { position: relative; padding-left: 10px; }
.m-card-head span:first-child::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; border-radius: 2px; background: var(--m-gradient);
}
.m-card-head .m-card-action { font-size: 13px; color: var(--m-primary); font-weight: 500; }
.m-card-body { padding: 6px 16px 6px; }

/* ---------- 统计宫格 ---------- */
.m-stat-grid { display: grid; gap: 10px; padding: 4px 0; }
.m-stat-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.m-stat-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.m-stat {
  background: var(--m-gradient-soft); border-radius: 12px; padding: 14px 10px; text-align: center;
}
.m-stat-val { font-size: 22px; font-weight: 700; background: var(--m-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.m-stat-label { font-size: 12px; color: var(--m-text-2); margin-top: 2px; }
.m-stat-label i { font-size: 13px; margin-right: 2px; }

/* ---------- 列表 ---------- */
.m-list { background: var(--m-card); border-radius: var(--m-radius); overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.04); margin-bottom: 12px; }
.m-list-item { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-bottom: 1px solid var(--m-line); }
.m-list-item:last-child { border-bottom: none; }
.m-list-item > i.mdi:first-child { font-size: 22px; color: var(--m-primary); flex: 0 0 24px; text-align: center; }
.m-list-main { flex: 1; min-width: 0; }
.m-list-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-list-desc { font-size: 12px; color: var(--m-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.m-list-right { font-size: 13px; color: var(--m-text-2); flex: 0 0 auto; }
.m-list-arrow { color: #c7c7cc; font-size: 20px; flex: 0 0 20px; }

/* ---------- 表单 ---------- */
.m-form-group { margin-bottom: 16px; }
.m-form-label { display: block; font-size: 13px; font-weight: 500; color: #3c3c43; margin-bottom: 8px; }
.m-input, .m-select, .m-textarea {
  width: 100%; border: 1.5px solid var(--m-line); border-radius: 12px;
  padding: 0 14px; height: 48px; font-size: 15px; color: var(--m-text); background: #fff; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.m-textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; }
.m-input:focus, .m-select:focus, .m-textarea:focus { border-color: var(--m-primary); box-shadow: 0 0 0 4px rgba(0,189,233,.12); }
.m-input-wrap { position: relative; }
.m-input-wrap > i.mdi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #aeaeb2; font-size: 20px; }
.m-input-wrap .m-input { padding-left: 44px; }
.m-form-hint { font-size: 12px; color: var(--m-text-2); margin-top: 6px; }

/* ---------- 按钮 ---------- */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; padding: 0 6px;
  width: 100%; height: 40px; border: none; border-radius: 14px;
  background: var(--m-gradient); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,189,233,.28); transition: transform .15s, box-shadow .15s;
}
.m-btn:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(0,189,233,.28); }
.m-btn--ghost { background: #fff; color: var(--m-primary); border: 1.5px solid var(--m-primary); box-shadow: none; }
.m-btn--block { display: flex; margin-top: 8px; }
.m-link-btn { background: none; border: none; color: var(--m-primary); font-size: 13px; padding: 4px 6px; cursor: pointer; }
.m-link-btn:active { opacity: .6; }

/* 输入框内嵌的验证码按钮 */
.m-code-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--m-gradient); color: #fff; font-size: 12px; font-weight: 600;
  padding: 8px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.m-code-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 功能入口网格 ---------- */
.m-grid { display: grid; gap: 10px; padding: 4px 0; }
.m-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.m-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.m-grid-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; background: #fff; border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.04); transition: transform .15s; }
.m-grid-item:active { transform: scale(.96); }
.m-grid-icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--m-gradient-soft); color: var(--m-primary-d); }
.m-grid-icon i { font-size: 22px; }
.m-grid-label { font-size: 12px; color: #3c3c43; }

/* ---------- 底部标签导航 ---------- */
.m-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--m-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--m-line);
}
.m-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--m-text-2); font-size: 11px; transition: color .15s; }
.m-nav-item i { font-size: 22px; }
.m-nav-item.active { color: var(--m-primary); font-weight: 600; }
.m-nav-item.active i { background: var(--m-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* 图标定位容器：承载右上角未读徽标 */
.m-nav-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; }
/* 未读角标（底部导航 / 功能网格通用） */
.m-nav-badge, .m-grid-badge {
  position: absolute; z-index: 2;
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  background: #ff3b30; color: #fff; font-size: 10px; font-style: normal;
  font-weight: 600; line-height: 16px; text-align: center; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(255, 59, 48, .5);
}
.m-nav-badge { top: -5px; right: -13px; }
.m-grid-icon { position: relative; }
.m-grid-badge { top: -6px; right: -7px; }
/* 工单列表行：未读红点 + 未读数徽章 */
.m-ticket-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #ff3b30; margin-right: 5px; vertical-align: middle;
  animation: mTicketPulse 1.4s ease-in-out infinite;
}
@keyframes mTicketPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(1.35); }
}
.m-ticket-badge {
  display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  background: #ff3b30; color: #fff; font-size: 10px; font-style: normal; font-weight: 600;
  line-height: 16px; text-align: center; border-radius: 8px; margin-left: 6px; vertical-align: middle;
  box-shadow: 0 1px 3px rgba(255, 59, 48, .4);
}

/* ---------- 空状态 ---------- */
.m-empty { text-align: center; padding: 48px 16px; color: var(--m-text-2); }
.m-empty i { font-size: 48px; opacity: .4; }
.m-empty p { margin-top: 10px; font-size: 14px; }

/* ---------- 电脑版切换 ---------- */
.m-switch-bar { text-align: center; padding: 14px; font-size: 12px; color: var(--m-text-2); }
.m-switch-bar a { color: var(--m-primary); }

/* ---------- Toast ---------- */
.m-toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; z-index: 9999; max-width: 80%; text-align: center; opacity: 0;
  transition: opacity .25s; pointer-events: none;
}
.m-toast.show { opacity: 1; }
.m-toast.success { background: rgba(52,199,89,.92); }
.m-toast.error { background: rgba(255,59,48,.92); }

/* ---------- 通用工具 ---------- */
.m-mt { margin-top: 12px; }
.m-mb { margin-bottom: 12px; }
.m-text-2 { color: var(--m-text-2); }
.m-center { text-align: center; }
.m-row { display: flex; justify-content:space-around; gap: 10px; }
.m-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--m-gradient-soft); color: var(--m-primary-d); }
.m-tag--green { background: rgba(126,217,87,.15); color: #2e9e3f; }
.m-tag--red { background: rgba(255,59,48,.12); color: #d70015; }
.m-tag--gray { background: #f0f0f3; color: #8e8e93; }
.m-brand-text { background: var(--m-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.m-hero { text-align: center; padding: 20px 0 8px; }
.m-hero h1 { font-size: 22px; }
.m-hero p { color: var(--m-text-2); font-size: 13px; margin-top: 4px; }

/* ==========================================================================
   以下两部分原独立文件，已并入本文件（static/m/m.css）以减少文件数与部署漏传：
     · 移动端公共组件样式（原 m-components.css：弹窗公告 + 通用确认/选择弹窗）
     · 移动端首页专有样式（原 m-home.css：游客条 / 业务 Tab / 书签 / 富文本 / 结果提示）
   ========================================================================== */

/* ---------- 弹窗公告（原 m-components.css） ---------- */
.m-ann-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .55); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.m-ann-dialog {
  width: 100%; max-width: 340px; background: #fff; border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column; max-height: 76vh;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
  animation: mAnnPop .25s ease;
}
@keyframes mAnnPop {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.m-ann-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; color: #fff; font-size: 15px; font-weight: 600;
  background: var(--m-gradient);
}
.m-ann-head .mdi-bullhorn { font-size: 18px; }
#mAnnTitle { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-ann-close {
  flex: none; width: 24px; height: 24px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .25); color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.m-ann-body {
  flex: 1; overflow-y: auto; padding: 14px 16px 4px;
  font-size: 14px; line-height: 1.8; color: #333; word-break: break-word;
  -webkit-overflow-scrolling: touch;
}
.m-ann-meta { padding: 4px 16px 10px; font-size: 12px; color: #999; }
.m-ann-foot {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 14px; border-top: 1px solid var(--line, #eef0f3);
}
.m-ann-btn {
  flex: none; border: 1px solid var(--line, #eef0f3); background: #fff; color: #666;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.m-ann-btn--primary { background: var(--m-primary); border-color: var(--m-primary); color: #fff; }
.m-ann-counter { margin-left: auto; font-size: 12px; color: #999; }

/* ---------- 通用确认弹窗（替代原生 confirm，全站复用） ---------- */
.m-confirm-mask {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 10000;
  background: rgba(0, 0, 0, .45);
  display: none; align-items: center; justify-content: center;
}
.m-confirm-mask.is-open { display: flex; }
.m-confirm-dialog {
  width: 78%; max-width: 320px; background: #fff;
  border-radius: 14px; padding: 20px 18px; text-align: center;
}
.m-confirm-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.m-confirm-body { font-size: 13px; color: #666; line-height: 1.7; }
.m-confirm-actions { display: flex; gap: 8px; margin-top: 16px; }
.m-confirm-btn {
  flex: 1; padding: 10px; border: 1px solid #eee; background: #fff;
  border-radius: 8px; font-size: 14px; cursor: pointer;
}
.m-confirm-btn--primary {
  border: none; background: var(--m-primary); color: #fff; font-weight: 600;
}

/* ---------- 通用选择弹窗（底部动作面板，mChoose） ---------- */
.m-choose-mask {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 10001;
  background: rgba(0, 0, 0, .45);
  display: none; align-items: flex-end; justify-content: center;
}
.m-choose-mask.is-open { display: flex; }
.m-choose-sheet {
  width: 100%; max-width: 480px; background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 14px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  animation: mChooseUp .22s ease;
}
@keyframes mChooseUp {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
.m-choose-title { font-weight: 700; font-size: 15px; text-align: center; }
.m-choose-desc {
  font-size: 12px; color: var(--text-2, #8e8e93); margin-top: 6px;
  text-align: center; white-space: pre-wrap; line-height: 1.6;
}
.m-choose-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.m-choose-item {
  width: 100%; text-align: left; padding: 12px 14px;
  border: 1px solid var(--m-line, #eef0f3); border-radius: 10px;
  background: var(--surface, #fff); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.m-choose-item:active { background: var(--brand-a08, rgba(0,189,233,.08)); border-color: var(--m-primary); }
.m-choose-item b { display: block; font-size: 14px; font-weight: 600; }
.m-choose-item span { display: block; font-size: 12px; color: var(--text-2, #8e8e93); margin-top: 2px; }
.m-choose-cancel {
  margin-top: 10px; width: 100%; padding: 12px;
  border: none; background: #f2f4f7; border-radius: 10px;
  font-size: 14px; color: var(--text-2, #8e8e93); cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .m-ann-dialog { animation: none; }
  .m-choose-sheet { animation: none; }
}

/* ---------- 首页专有样式（原 m-home.css） ---------- */
.m-guest-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 12px;
  padding: 8px 12px;
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: #8a6100;
  line-height: 1.5;
}
.m-guest-bar i { flex: none; font-size: 15px; }
.m-guest-bar span { flex: 1; }
.m-guest-bar a {
  flex: none;
  color: var(--m-primary);
  font-weight: 600;
  text-decoration: none;
  padding: 2px 10px;
  border: 1px solid var(--m-primary);
  border-radius: var(--r-pill);
}

.m-tab-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0 16px 12px;
  background: var(--surface-3);
  border-radius: var(--r-md);
  padding: 4px;
}
.m-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 4px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.m-tab-btn i { font-size: 15px; vertical-align: middle; margin-right: 2px; }
.m-tab-btn.is-active {
  background: var(--m-gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--brand-a28);
}
.m-tab-pane { animation: mFadeIn .3s ease; }
@keyframes mFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.m-bm-row {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  border: 1px solid var(--line);
}
.m-bm-row .m-bm-title { margin-bottom: 4px; }

.m-text-editor-wrap {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.m-text-editor-wrap .w-e-toolbar { border-bottom: 1px solid var(--line) !important; flex-wrap: wrap; }

.m-guest-tip {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-left: 4px solid #f6a623;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.6;
  color: #8a6100;
  text-align: left;
}
.m-guest-tip i { flex: none; font-size: 16px; line-height: 1.5; }
.m-guest-tip a { color: var(--m-primary); font-weight: 600; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .m-tab-pane { animation: none; }
}
