/* 卓林 · 项目手机台 —— 移动优先 */
:root {
  --bg: #f2f3f5;
  --card: #fff;
  --line: #ebedf0;
  --tx: #1a1d21;
  --tx2: #6b7280;
  --tx3: #9ba1aa;
  --pri: #2563eb;
  --pri-l: #eef4ff;
  --red: #dc2626;
  --red-l: #fef2f2;
  --org: #ea580c;
  --org-l: #fff7ed;
  --grn: #16a34a;
  --grn-l: #f0fdf4;
  --r: 14px;
  --bar: 52px;
  --tab: 58px;
  --sab: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* ---------- 顶栏 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--bar) + var(--sat));
  padding: var(--sat) 8px 0;
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.ab-side { width: 44px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ab-back { color: var(--pri); margin-left: -4px; }
.ab-title {
  flex: 1; min-width: 0; font-size: 17px; font-weight: 600;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 2px;
}
.ab-right { justify-content: flex-end; }
.ab-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  color: var(--pri); border-radius: 50%;
}
.ab-btn:active { background: var(--pri-l); }

/* ---------- 内容 ---------- */
.content {
  padding: 12px 12px calc(var(--tab) + var(--sab) + 20px);
  max-width: 680px; margin: 0 auto;
}

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; height: calc(var(--tab) + var(--sab));
  padding-bottom: var(--sab);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--tx3); font-size: 11px;
}
.tab.on { color: var(--pri); }
.tab.on svg { transform: translateY(-1px); }

/* ---------- 问候 ---------- */
.hello { padding: 6px 4px 14px; }
.hello-hi { font-size: 21px; font-weight: 700; letter-spacing: .3px; }
.hello-sub { font-size: 13px; color: var(--tx2); margin-top: 4px; }

/* ---------- 分段 ---------- */
.seg {
  display: flex; gap: 4px; background: #e9eaee; border-radius: 10px;
  padding: 3px; margin-bottom: 14px;
}
.seg-i {
  flex: 1; text-align: center; padding: 7px 0; font-size: 14px;
  color: var(--tx2); border-radius: 8px;
}
.seg-i.on {
  background: #fff; color: var(--tx); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ---------- 分组 ---------- */
.grp { margin-bottom: 18px; }
.grp-hd { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px; }
.grp-t { font-size: 13px; font-weight: 600; color: var(--tx2); letter-spacing: .5px; }
.grp-n {
  font-size: 11px; color: var(--tx3); background: #e6e8ec;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-grid; place-items: center; padding: 0 5px;
}
.c-red { color: var(--red) !important; }
.c-org { color: var(--org) !important; }
.c-grn { color: var(--grn) !important; }
.c-mut { color: var(--tx3) !important; }
.c-blue { color: var(--pri) !important; }

/* ---------- 列表 / 任务 ---------- */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; }
.task {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px; min-height: 56px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.task:last-child { border-bottom: 0; }
.task:active { background: #fafafa; }
.check {
  flex: 0 0 auto; width: 26px; height: 26px; margin-top: 1px;
  border-radius: 50%; border: 1.8px solid #cfd4db;
  display: grid; place-items: center; color: transparent;
  transition: all .18s;
}
.check:active { transform: scale(.92); }
.check.on, .is-done .check { background: var(--grn); border-color: var(--grn); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-t { font-size: 15px; line-height: 1.4; word-break: break-word; }
.task-c { font-size: 12.5px; color: var(--tx2); margin-top: 3px; }
.task-m { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; align-items: center; }
.task-side {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; padding-top: 1px;
}
.due { font-size: 11.5px; white-space: nowrap; }
.is-done .task-t { color: var(--tx3); text-decoration: line-through; }

.tag-p {
  font-size: 11.5px; color: var(--pri); background: var(--pri-l);
  padding: 1px 7px; border-radius: 5px; max-width: 160px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag {
  font-size: 11px; padding: 1px 6px; border-radius: 5px; white-space: nowrap;
  background: #f1f2f4; color: var(--tx2);
}
.tag-red { background: var(--red-l); color: var(--red); }
.tag-org { background: var(--org-l); color: var(--org); }
.tag-blue { background: var(--pri-l); color: var(--pri); }
.tag-grn { background: var(--grn-l); color: var(--grn); }
.tag-mut { background: #f1f2f4; color: var(--tx3); }

/* 类型标签 */
.tag-type {
  font-size: 11px; padding: 2px 7px; border-radius: 5px;
  background: var(--pri-l); color: var(--pri);
}
.tag-type.tag-sheji { background: #f5f3ff; color: #7c3aed; }
.tag-type.tag-shigong { background: var(--org-l); color: var(--org); }
.tag-type.tag-cailiao { background: #ecfeff; color: #0891b2; }
.tag-type.tag-other { background: #f1f2f4; color: var(--tx2); }

/* ---------- 头像 ---------- */
.av {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-grid; place-items: center;
  color: #fff; font-size: 12.5px; font-weight: 500;
}
.av.sm { width: 22px; height: 22px; font-size: 11px; }
.av-empty { background: #e5e7eb; color: var(--tx3); }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 60px 20px; }
.empty-ico { font-size: 40px; }
.empty-t { font-size: 15px; font-weight: 600; margin-top: 8px; }
.empty-s { font-size: 13px; color: var(--tx3); margin-top: 4px; }
.mini-empty { font-size: 13px; color: var(--tx3); padding: 14px 4px; }

/* ---------- 提示 ---------- */
.toast {
  font-size: 13px; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px;
}
.toast-ok { background: var(--grn-l); color: var(--grn); }
.toast-err { background: var(--red-l); color: var(--red); }
.hint { font-size: 12px; color: var(--tx3); margin-top: 8px; padding: 0 2px; }

/* ---------- 项目卡 ---------- */
.search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 11px; padding: 9px 12px; margin-bottom: 10px;
  color: var(--tx3);
}
.search input {
  flex: 1; border: 0; outline: 0; background: none; font-size: 15px; color: var(--tx);
}
.plist { display: flex; flex-direction: column; gap: 10px; }
.pcard {
  display: block; background: var(--card); border-radius: var(--r); padding: 13px 14px;
  transition: transform .12s;
}
.pcard:active { transform: scale(.985); background: #fafbfc; }
.pcard.is-done { opacity: .72; }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pc-name {
  font-size: 16px; font-weight: 600; line-height: 1.35;
  word-break: break-word; flex: 1; min-width: 0;
}
.star { color: #f59e0b; margin-right: 3px; }
.pc-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 12.5px; color: var(--tx2); margin-top: 7px;
}
.dot { color: var(--tx3); }
.pc-prog { display: flex; align-items: center; gap: 9px; margin-top: 11px; }
.bar { flex: 1; height: 6px; background: #edeff2; border-radius: 3px; overflow: hidden; }
.bar.big { height: 9px; border-radius: 5px; margin: 4px 0 8px; }
.bar i {
  display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: inherit; transition: width .35s;
}
.pc-pct { font-size: 11.5px; color: var(--tx3); font-variant-numeric: tabular-nums; }
.pc-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding-top: 9px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--tx2);
}
.pc-tk { margin-left: auto; color: var(--tx3); }

/* ---------- 项目详情 ---------- */
.ph { padding: 2px 4px 14px; }
.ph-tags { display: flex; gap: 6px; margin-bottom: 9px; flex-wrap: wrap; }
.ph-info {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 14px; color: var(--tx2);
}
.ph-addr { font-size: 13px; color: var(--tx2); margin-top: 6px; }
.ph-remark {
  font-size: 13px; color: var(--tx2); background: #fff; border-radius: 10px;
  padding: 10px 12px; margin-top: 10px; line-height: 1.55;
}
.ph-mem { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.ph-mem .av { margin-right: -6px; box-shadow: 0 0 0 2px #f2f3f5; }
.ph-mem-n { font-size: 12px; color: var(--tx3); margin-left: 12px; }

.blk {
  background: var(--card); border-radius: var(--r);
  padding: 14px; margin-bottom: 12px;
}
.blk-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.blk-t { font-size: 15px; font-weight: 600; }
.blk-n { font-size: 12px; color: var(--tx3); }
.blk-add {
  margin-left: auto; font-size: 13px; color: var(--pri);
  padding: 5px 10px; background: var(--pri-l); border-radius: 8px;
}
.next-hint { font-size: 13px; color: var(--tx2); margin-bottom: 6px; }

/* 阶段时间轴 */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.tl {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 9px 0; position: relative;
}
.tl::before {
  content: ""; position: absolute; left: 12px; top: 34px; bottom: -2px;
  width: 2px; background: #e9ebef;
}
.tl:last-child::before { display: none; }
.tl.on::before { background: #bfe3c9; }
.tl-dot {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1.8px solid #d3d8df; background: #fff; color: var(--tx3);
  font-size: 12px; font-weight: 600; display: grid; place-items: center;
  transition: all .18s; z-index: 1;
}
.tl.on .tl-dot { background: var(--grn); border-color: var(--grn); color: #fff; }
.tl-main { padding-top: 2px; }
.tl-name { font-size: 14.5px; }
.tl.on .tl-name { color: var(--tx2); }
.tl-date { font-size: 11.5px; color: var(--tx3); margin-top: 1px; }

/* 附件 */
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.shot {
  aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #f4f5f7;
  display: grid; place-items: center;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-file { font-size: 11px; color: var(--tx2); font-weight: 600; }
.shot-add { aspect-ratio: 1; }
.shot-btn {
  width: 100%; height: 100%; border-radius: 9px;
  border: 1.5px dashed #cfd5dd; background: #fafbfc;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--tx3); font-size: 10.5px;
}
.shot-btn:active { background: var(--pri-l); border-color: var(--pri); color: var(--pri); }

.done-fold { margin-top: 10px; }
.done-fold summary {
  font-size: 13px; color: var(--tx3); padding: 8px 2px; cursor: pointer;
  list-style: none;
}
.done-fold summary::-webkit-details-marker { display: none; }
.done-fold summary::before { content: "▸ "; }
.done-fold[open] summary::before { content: "▾ "; }

/* ---------- 我的 ---------- */
.me-top { display: flex; align-items: center; gap: 14px; padding: 8px 4px 18px; }
.me-av {
  width: 58px; height: 58px; border-radius: 50%; color: #fff;
  display: grid; place-items: center; font-size: 24px; font-weight: 500;
}
.me-name { font-size: 19px; font-weight: 700; }
.me-role { font-size: 13px; color: var(--tx2); margin-top: 3px; }
.me-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px;
}
.ms {
  background: #fff; border-radius: 12px; padding: 12px 4px; text-align: center;
}
.ms b { display: block; font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.ms span { font-size: 11.5px; color: var(--tx2); }
.ms-red b { color: var(--red); }

.ulist { display: flex; flex-direction: column; }
.urow {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.urow:last-child { border-bottom: 0; }
.urow-main { flex: 1; min-width: 0; }
.urow-n { font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.urow-s { font-size: 12px; color: var(--tx3); margin-top: 1px; }
.urow-more {
  color: var(--tx3); font-size: 16px; padding: 6px 8px; letter-spacing: 1px;
}

.opt {
  display: block; width: 100%; text-align: left;
  padding: 13px 2px; font-size: 15px; border-bottom: 1px solid var(--line);
  color: var(--tx);
}
.opt:last-child { border-bottom: 0; }
.opt-red { color: var(--red); }
.foot-tip {
  text-align: center; font-size: 11.5px; color: var(--tx3);
  padding: 18px 0 6px; line-height: 1.7;
}

/* ---------- 底部抽屉 ---------- */
.sheet { display: none; position: fixed; inset: 0; z-index: 100; }
.sheet.open { display: block; }
.sheet-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
  animation: fadeIn .18s;
}
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + var(--sab));
  max-height: 88vh; overflow-y: auto;
  animation: slideUp .22s cubic-bezier(.2,.8,.3,1);
  max-width: 680px; margin: 0 auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-hd {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 600; margin-bottom: 14px;
}
.sheet-x { font-size: 14px; font-weight: 400; color: var(--tx3); padding: 4px; }
.sheet-body input[type=text], .sheet-body input[type=password], .sheet-body input[type=tel],
.sheet-body input[type=number], .sheet-body input[type=date], .sheet-body select,
.sheet-body textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fafbfc; outline: none;
  font-size: 15px; margin-bottom: 10px; -webkit-appearance: none;
}
.sheet-body select { appearance: none; background-image: none; }
.sheet-body input:focus, .sheet-body select:focus, .sheet-body textarea:focus {
  border-color: var(--pri); background: #fff;
}
.sheet-body textarea { resize: vertical; }
.sheet-row { display: flex; gap: 10px; }
.sheet-row > * { flex: 1; min-width: 0; }
.fld-in { display: block; }
.fld-in span { font-size: 12px; color: var(--tx3); display: block; margin-bottom: 4px; }
.chk-line {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  color: var(--tx2); padding: 4px 2px 12px;
}
.chk-line input { width: 18px; height: 18px; accent-color: var(--pri); margin: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 18px; border-radius: 11px;
  font-size: 16px; font-weight: 500; border: 0;
}
.btn-pri { background: var(--pri); color: #fff; }
.btn-pri:active { background: #1d4ed8; }
.btn-block { display: flex; width: 100%; margin-top: 6px; }

/* ---------- 登录 ---------- */
.login-body {
  background: #fff; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-wrap { width: 100%; max-width: 360px; }
.login-brand { text-align: center; margin-bottom: 30px; }
.login-logo {
  width: 62px; height: 62px; border-radius: 17px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff;
  display: grid; place-items: center; font-size: 27px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(37,99,235,.28);
}
.login-t { font-size: 21px; font-weight: 700; }
.login-s { font-size: 13px; color: var(--tx3); margin-top: 5px; }
.login-form .fld { display: block; margin-bottom: 13px; }
.fld-lb { font-size: 12.5px; color: var(--tx2); display: block; margin-bottom: 6px; }
.login-form input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 11px; background: #f7f8fa; outline: none; font-size: 16px;
}
.login-form input:focus { border-color: var(--pri); background: #fff; }
.login-err {
  font-size: 13px; color: var(--red); background: var(--red-l);
  padding: 9px 12px; border-radius: 9px; margin-bottom: 12px;
}
.login-tip { text-align: center; font-size: 12px; color: var(--tx3); margin-top: 20px; }
.login-form .btn { margin-top: 6px; }

/* 表格 */
.tbl { width: 100%; font-size: 13px; border-collapse: collapse; }
.tbl td { padding: 7px 2px; border-bottom: 1px solid var(--line); }

@media (min-width: 700px) {
  .content { padding-left: 16px; padding-right: 16px; }
  .shots { grid-template-columns: repeat(6, 1fr); }
}
