/* 移动端原型通用样式（375 宽 iPhone 模拟，部署后手机浏览器自适配全屏） */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: #1f2933; background: #f4f5f7; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; }
input, textarea, select { font: inherit; }

/* 设备框（PC 浏览器查看时居中显示，手机自适配） */
.m-device {
  max-width: 420px; margin: 0 auto; min-height: 100vh;
  background: #f4f5f7; position: relative; padding-bottom: 64px;
  box-shadow: 0 0 24px rgba(0,0,0,.08);
}
@media (max-width: 420px) { .m-device { box-shadow: none; } }

/* 状态栏（模拟） */
.m-statusbar {
  height: 28px; background: #fff; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: #1f2933;
}
.m-statusbar .right { display: flex; gap: 4px; align-items: center; }

/* 顶部导航 */
.m-navbar {
  height: 44px; background: #fff; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #f0f0f0; position: sticky; top: 0; z-index: 10;
}
.m-navbar .back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #2d8cf0; }
.m-navbar .title { font-size: 16px; font-weight: 600; flex: 1; text-align: center; }
.m-navbar .action { color: #2d8cf0; font-size: 14px; padding: 0 4px; }
.m-navbar .action.disabled { color: #c0c4cc; }

/* 主体内容 */
.m-body { padding: 12px; }

/* 卡片 */
.m-card {
  background: #fff; border-radius: 8px; padding: 12px;
  margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.m-card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.m-card-title .more { color: #2d8cf0; font-size: 12px; font-weight: normal; }

/* 列表项 */
.m-list { background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.m-list-item {
  display: flex; align-items: center; padding: 12px;
  border-bottom: 1px solid #f5f5f5; min-height: 56px;
}
.m-list-item:last-child { border-bottom: none; }
.m-list-item .icon { width: 36px; height: 36px; border-radius: 8px; background: #e6f0ff; color: #2d8cf0; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-right: 12px; flex-shrink: 0; }
.m-list-item .main { flex: 1; min-width: 0; }
.m-list-item .name { font-weight: 500; color: #1f2933; }
.m-list-item .desc { color: #888; font-size: 12px; margin-top: 2px; }
.m-list-item .arrow { color: #c0c4cc; font-size: 14px; margin-left: 8px; }
.m-list-item .right { color: #888; font-size: 12px; text-align: right; }

/* 任务卡 */
.m-task {
  background: #fff; border-radius: 10px; padding: 14px;
  margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  border-left: 4px solid #2d8cf0;
}
.m-task.urgent { border-left-color: #f5222d; }
.m-task.done { border-left-color: #52c41a; opacity: .7; }
.m-task-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.m-task-name { font-weight: 600; font-size: 15px; }
.m-task-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e6f0ff; color: #2d8cf0; }
.m-task-status.urgent { background: #fff1f0; color: #f5222d; }
.m-task-status.done { background: #f6ffed; color: #52c41a; }
.m-task-status.warn { background: #fff7e6; color: #fa8c16; }
.m-task-meta { font-size: 12px; color: #666; line-height: 1.8; }
.m-task-meta .label { color: #999; display: inline-block; min-width: 56px; }
.m-task-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 按钮 */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  background: #f0f5ff; color: #2d8cf0; border: 1px solid #d6e4ff;
}
.m-btn-primary { background: #2d8cf0; color: #fff; border-color: #2d8cf0; }
.m-btn-success { background: #52c41a; color: #fff; border-color: #52c41a; }
.m-btn-danger { background: #fff; color: #f5222d; border-color: #ffa39e; }
.m-btn-block { width: 100%; }
.m-btn-lg { height: 44px; font-size: 16px; }

/* 大底部按钮 */
.m-bottom-bar {
  position: fixed; bottom: 64px; left: 0; right: 0; padding: 8px 12px;
  background: #fff; border-top: 1px solid #f0f0f0;
  max-width: 420px; margin: 0 auto; display: flex; gap: 8px;
}
.m-bottom-bar .m-btn { flex: 1; }

/* 统计卡 */
.m-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.m-stat {
  background: #fff; border-radius: 8px; padding: 12px; text-align: center;
}
.m-stat .v { font-size: 22px; font-weight: 700; color: #2d8cf0; }
.m-stat .l { font-size: 12px; color: #666; margin-top: 2px; }

/* 底部 Tab */
.m-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px; background: #fff; border-top: 1px solid #f0f0f0;
  display: flex; max-width: 420px; margin: 0 auto; z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.m-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: #999; gap: 2px;
}
.m-tabbar a.active { color: #2d8cf0; }
.m-tabbar a .ico { font-size: 22px; }

/* 表单 */
.m-form-item { background: #fff; padding: 12px; border-bottom: 1px solid #f5f5f5; }
.m-form-item .label { font-size: 13px; color: #666; margin-bottom: 6px; }
.m-form-item .input { width: 100%; border: 1px solid #d9d9d9; padding: 8px 10px; border-radius: 6px; font-size: 14px; outline: none; }
.m-form-item .input:focus { border-color: #2d8cf0; }
.m-form-item textarea.input { min-height: 80px; resize: vertical; }
.m-form-row { display: flex; padding: 12px; background: #fff; border-bottom: 1px solid #f5f5f5; }
.m-form-row .label { width: 80px; color: #666; font-size: 14px; flex-shrink: 0; }
.m-form-row .value { flex: 1; color: #1f2933; }
.m-form-row .value.muted { color: #999; }

/* 量表选项 */
.m-scale-q { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.m-scale-q .qno { font-size: 12px; color: #2d8cf0; font-weight: 600; }
.m-scale-q .qtxt { font-size: 14px; font-weight: 500; margin: 4px 0 10px; line-height: 1.5; }
.m-scale-opt {
  display: flex; align-items: center; padding: 10px;
  border: 1px solid #e8eaec; border-radius: 6px; margin-bottom: 6px;
  font-size: 14px;
}
.m-scale-opt.selected { background: #e6f0ff; border-color: #2d8cf0; color: #2d8cf0; font-weight: 500; }
.m-scale-opt .score { margin-left: auto; color: #999; font-size: 12px; }
.m-scale-opt.selected .score { color: #2d8cf0; }

/* 标签 */
.m-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: #f0f5ff; color: #2d8cf0; }
.m-tag.warn { background: #fff7e6; color: #fa8c16; }
.m-tag.danger { background: #fff1f0; color: #f5222d; }
.m-tag.success { background: #f6ffed; color: #52c41a; }
.m-tag.gray { background: #f5f5f5; color: #888; }

/* 拍照位 */
.m-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-photo-cell { aspect-ratio: 1; border-radius: 6px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 12px; position: relative; overflow: hidden; }
.m-photo-cell.has { background: linear-gradient(135deg, #e6f0ff, #f0f5ff); color: #2d8cf0; }
.m-photo-cell .badge { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; }

/* 进度条 */
.m-progress { background: #f0f0f0; height: 6px; border-radius: 3px; overflow: hidden; }
.m-progress .bar { height: 100%; background: linear-gradient(90deg, #2d8cf0, #5ca8ff); transition: width .3s; }

/* 通用工具 */
.m-flex { display: flex; align-items: center; }
.m-flex-between { display: flex; align-items: center; justify-content: space-between; }
.m-mt { margin-top: 12px; }
.m-mb { margin-bottom: 12px; }
.m-muted { color: #999; }
.m-small { font-size: 12px; }
.m-big { font-size: 18px; font-weight: 600; }
.m-center { text-align: center; }

/* 头部横幅 */
.m-banner {
  background: linear-gradient(135deg, #2d8cf0, #5ca8ff);
  color: #fff; padding: 16px 16px 28px; margin: -12px -12px 12px;
  border-radius: 0 0 20px 20px; position: relative;
}
.m-banner.green { background: linear-gradient(135deg, #52c41a, #95de64); }
.m-banner.orange { background: linear-gradient(135deg, #fa8c16, #ffa940); }
.m-banner h2 { margin: 0 0 4px; font-size: 18px; }
.m-banner p { margin: 0; opacity: .9; font-size: 12px; }

/* 提示信息 */
.m-alert { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.m-alert.info { background: #e6f7ff; color: #1890ff; border-left: 3px solid #1890ff; }
.m-alert.warn { background: #fff7e6; color: #fa8c16; border-left: 3px solid #fa8c16; }
.m-alert.success { background: #f6ffed; color: #52c41a; border-left: 3px solid #52c41a; }
.m-alert.danger { background: #fff1f0; color: #f5222d; border-left: 3px solid #f5222d; }

/* 签名/绘图区 */
.m-sign-pad {
  background: #fafafa; border: 1px dashed #d9d9d9; border-radius: 6px;
  height: 180px; display: flex; align-items: center; justify-content: center;
  color: #aaa; font-size: 13px; background-image: linear-gradient(45deg, transparent 49%, #999 50%, transparent 51%); background-size: 20px 20px;
}
