/* ============================================================================
   移动端外壳：三方推荐人（手机优先 375px）、站长（响应式）
   单列布局、大触控区（≥44px）、底部固定提交条、底部标签导航。
   ========================================================================== */

body[data-client="mobile"] {
  padding-bottom: 62px; /* 给底部标签栏留位 */
}
body[data-client="mobile"].has-bottom-action { padding-bottom: 128px; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 52px;
  padding: 8px var(--s-4);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar .title { font-size: var(--t-md); font-weight: 650; }
.appbar .sub { font-size: 11px; color: var(--ink-3); }
.appbar .back { border: 0; background: transparent; font-size: 20px; padding: 0 6px 0 0; color: var(--ink-2); cursor: pointer; }

.mview { padding: var(--s-4) var(--s-4) var(--s-6); max-width: 560px; margin: 0 auto; }
body[data-resp="1"] .mview { max-width: 1080px; }
@media (min-width: 720px) {
  body[data-resp="1"] .mview { padding: var(--s-5) var(--s-5) var(--s-7); }
}

/* 卡片 */
.cards { display: grid; gap: var(--s-3); }
@media (min-width: 720px) {
  body[data-resp="1"] .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: var(--s-3) var(--s-4);
}
.card.is-danger { border-left-color: var(--danger); }
.card.is-warn { border-left-color: var(--warn); }
.card.is-ok { border-left-color: var(--ok); }
.card.is-info { border-left-color: var(--info); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.card-name { font-size: var(--t-md); font-weight: 650; }
.card-meta { font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }
.card-body { margin-top: var(--s-3); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.card-stat { border-top: 1px solid var(--line); padding-top: 6px; }
.card-stat .k { font-size: 11px; color: var(--ink-3); }
.card-stat .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 650; font-size: var(--t-md); }
.card-foot { margin-top: var(--s-3); display: flex; gap: var(--s-2); }
.card-foot .btn { flex: 1; }

/* 移动端表单：触控友好的大控件 */
.mform .field > label { font-size: var(--t-sm); }
.mform input, .mform select, .mform textarea { min-height: 46px; font-size: 16px; /* 防 iOS 缩放 */ }
.mform textarea { min-height: 92px; }
.mform .field { margin-bottom: var(--s-4); }

/* 底部固定操作条 */
.bottom-action {
  position: fixed;
  left: 0; right: 0;
  bottom: 62px;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 25;
}
@media (min-width: 640px) {
  body[data-resp="1"] .bottom-action { max-width: 1080px; margin: 0 auto; }
}

/* 底部标签栏 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a .ico { font-size: 16px; line-height: 1; }
.tabbar a .nav-count {
  position: absolute;
  transform: translate(14px, -4px);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 0 4px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

/* 提交成功页 */
.done-card { text-align: center; padding: var(--s-6) var(--s-4); }
.done-mark {
  width: 52px; height: 52px; margin: 0 auto var(--s-4);
  border-radius: 50%; border: 2px solid var(--ok); color: var(--ok);
  display: grid; place-items: center; font-size: 26px;
}

/* 移动端弹层从底部升起 */
@media (max-width: 640px) {
  body[data-client="mobile"] .overlay { align-items: flex-end; padding: 0; }
  body[data-client="mobile"] .modal { width: 100%; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  body[data-client="mobile"] .modal-foot { border-radius: 0; }
  body[data-client="mobile"] .modal-foot .btn { flex: 1; min-height: 46px; }
  body[data-client="mobile"] .drawer { width: 100%; }
}

/* 移动端把「宽表格」变成键值行，避免横向滚动 */
@media (max-width: 640px) {
  .stacking { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
  .stacking table.data thead { display: none; }
  .stacking table.data, .stacking table.data tbody, .stacking table.data tr, .stacking table.data td { display: block; width: 100%; }
  .stacking table.data tr { border-bottom: 1px solid var(--line); padding: var(--s-2) var(--s-4); }
  .stacking table.data tr:last-child { border-bottom: 0; }
  .stacking table.data td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: var(--s-3); }
  .stacking table.data td::before { content: attr(data-label); color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; }
  .stacking table.data td:first-child { font-weight: 650; font-size: var(--t-md); }
  .stacking table.data td.col-actions { justify-content: flex-end; padding-top: var(--s-2); }
}
